1rosehip / jplist

jPList jQuery Data Grid Controls is a flexible jQuery plugin for sorting, pagination and filtering of any HTML structure (DIVs, UL/LI, tables, etc).
http://jplist.com
Other
436 stars 177 forks source link

Not Able to use collectionReadyEvent #267

Open sumit-intersoft opened 7 years ago

sumit-intersoft commented 7 years ago

I am trying to use the collectionReadyEvent ready event. But its not working. However the other event seems to be. This is the code i am using ` var $demo = $('#demo'); $demo.jplist({ itemsBox: '.list', itemPath: '.list-item', panelPath: '.jplist-panel', animateToTopDuration: 1000, effect: 'fade', }); var api = $demo.data('jplist'); var events = api.observer.events;

                        api.observer.on(events.collectionReadyEvent, function () {
                            console.log("collectionReadyEvent");
                        });
                        api.observer.on(events.unknownStatusesChanged, function ( {
                            console.log("unknownStatusesChanged");
                        });`

When i run this code the unknownStatusesChanged trigger callback seems to be run but collectionReadyEvent trigger callback is never fired.

I think the reason is the init function has been already fired. So i need to attach the collectionReadyEvent before initializing the jplist. But i am not sure i that can be achieved as we need the observer.events that can not be get after the jplist has been initialized.

So just wanted to know is there a way that i can use the collectionReadyEvent trigger.

Also is there a trigger before any filtering,sorting is applied like redrawCallback but that is called after the processing is done.

Simillarly is there a trigger before the filtering,sorting starts.