If you are creating an ajax driven site (meaning you are loading content via ajax requests and updating existing pages) there are a few things you should be aware of.
First and foremost, is that there is a lot going on under the hood of the IxF, as you can well imagine. We parse the page for specific classes and structure to do a lot of our default functionality. To do this we run a function called ixf.setup()
when the page is done loading. This function in turn calls 4 additional setup functions who's names are hopefully fairly obvious: setupPanels()
, setupGeneral()
, setupPopups()
, setupDataTables()
.
One thing to keep in mind is that ixf.setup()
only runs once after the page is done loading. If you bring in any additional content via ajax to insert into the page, the logic that ixf.setup()
has in it has not been run on that new content. You need to make sure to run ixf.setup()
again after any ajax content has been added to the page that has need of it's services.
If you put in a paragraph of text, you likely don't need to run it again as there is nothing to parse and act upon. But if your content has datepickers, tables, selectboxes, popups, etc. (anything you haven't specifically written the code to setup) then make sure to run ixf.setup()
again to give them the love they so richly deserve.
We have seen some projects try to be extra efficient and just run the part of the ixf.setup()
that they feel they need. Maybe they just run the fixSelect script that they copied from within the setupGeneral()
. It is understandable that they are wanting to be efficient by only running what is necessary. Currently the ixf.setup()
takes between 50-250ms to run on a fairly complex 3 panel page. Which isn't that bad, and we will continue to strive to make that faster.
Every part of the ixf.setup()
checks to see if things have already been run on a given match. So no code is run that isn't needed. If all you have is a select box that needs the fixSelect on it, that is all that is run.
Some issue we see by copying the content out of the setup functions are:
If you are really worried about the extra 200ms of time and you KNOW that your ajax will not have popups, tables or panels then you can call the setupGeneral()
which takes care of most of the fixSelect, datepicker, etc type stuff. This way you get the benefit of our latest and greatest, but are able to cut out a few thing you know you won't use.