[eluser]tof[/eluser]
[quote author="paulopmx" date="1216907081"][quote author="tof" date="1216757662"]hello,
i'm going to use flexigrid for my new programs.
however, i would like to dynamically parse the grid's attributes to add new functions to the grids (printing, csv output, etc).
i've passed the all day trying to get the colModel definition but i didnt succeed.
i want to get the colModel definition, the sortname & sortorder attributes, in javascript, so that i can generate the sql command coresponding to the user choices once he had played with the grid appearance...
maybe someone here can help me ?[/quote]
I actually don't understand why you need the grid's attributes to add new functions of (printing, csv output, etc).
But to get the attributes try this custom api method
Code:
$.fn.flexAttr = function(p) {
return this.each( function() {
if (this.grid) return this.p;
});
};
[/quote]
Thanks for the answer. i need it because i want to know what columns remains after the user had rearrange his grid, and what is the new sort criteria.
i can parse the DOM generated but i think it would be more accurate to get these informations directly from the attributes of the flexigrid component.
I have try to implement your function but when i call it by : jQuery('#mygrid').flexAttr('title'); i get an [Object] instead of the title attribute of the grid.