jQWidgets Forums

jQuery UI Widgets Forums Grid custom sorting with in built

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 8 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • custom sorting with in built #93654

    jahnvi25
    Participant

    i need to pre-process old data before i can perform sort operation. currently i tried using sort:function(column,direction){….}
    using customsort example provided in API.. but its not working as expected.

    i just need in-built sorting.. what is the best way to do it..
    below is the code i am using..

    
    var data = $resultsGrid.jqxGrid('getrows');;
    			var sortdata = new Array();
    			if (direction == 'ascending') direction = true;
    			if (direction == 'descending') direction = false;
    			if (direction != null) {
    				for (i = 0; i < data.length; i++) {
    					sortdata.push(data[i]);
    				}
    			}
    			else sortdata = data;
    			Object.prototype.toString = (typeof column == "function") ? column : function () { return this[column] };
    			if (direction != null) {
    				sortdata.sort();
    				if (!direction) {
    					sortdata.reverse();
    				}
    			}
    			source.localdata = sortdata;
    			$resultsGrid.jqxGrid('updatebounddata');
    custom sorting with in built #93656

    jahnvi25
    Participant

    never mind.. ignore this.. i figured out a way

    custom sorting with in built #93698

    jahnvi25
    Participant

    well. i do have question.when we use in-built sorting, ‘bindingComplete’ does not get called. but when we use custom sorting. it does.. is there a way to avoid this and still use custom sorting ?

    custom sorting with in built #93701

    Peter Stoev
    Keymaster

    Hi jahnvi25,

    bindingComplete is called when there’s a change in the bindine i.e update, re-bind thinks like that. As the custom sorting includes call of updating the data then the answer is no.

    Regards,
    Peter

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.