jsPanel4 icon indicating copy to clipboard operation
jsPanel4 copied to clipboard

updated methods jsPanel.ajax() and jsPanel.fetch()

Open Flyer53 opened this issue 5 years ago • 2 comments

v4.11.0-beta includes updated methods jsPanel.ajax() and jsPanel.fetch(). This updates also affect options contentAjax and contentFetch. Depending on how you use these methods and/or options the changes might break existing code. But the neccessary changes in your code should be quite easy to mke. It's mainly about the number of arguments and their order in the callbacks like done(), fail() etc.

To get the details please refer to the docs on the jsPanel pages: https://jspanel.de/

Background: I completely recoded the methods jsPanel.ajax() and jsPanel.fetch() because I wanted

  • to increase thir usability as general purpose methods
  • to get of using eval() internally
  • to increase functionality

Another addition in this context is the new method jsPanel.strToHtml(str) which takes a string value and returns a DocumentFragment.

Flyer53 avatar Jun 17 '20 11:06 Flyer53

Worked perfectly dude. Thanks alot. have a great day. one more question, is there a way to close all existing jspanel from a function? i have read the document but still cant find, maybe im need more time to read the document. oh, wait im beginner in javascript. so, im sorry if my question isnt make sense and my english is not good too. thanks alot dude.

randacpan avatar Jun 19 '20 07:06 randacpan

@randacpan To close all standard panels in the document:

jsPanel.getPanels().forEach(function(panel){
  panel.close();
});

jsPanel.getPanels(condition) returns an array with all the panels matching condition. Iterate over the panels to do whatever needs to be done ...

Flyer53 avatar Jun 19 '20 08:06 Flyer53