Thursday, 15 April 2010

kendo ui - KendoUI Grid custom sortable object alert or breakpoint not hit -



kendo ui - KendoUI Grid custom sortable object alert or breakpoint not hit -

i trying enforce custom sortable compare function columns in kendo grid, currency values can negative, null, 0, or positive. seeing inconsistent sorting across browsers , tried set break point or alert custom sortable object's function, neither beingness hit.

here illustration of setup salary column. salary field setup type number.

{ field: "salary", format: "{0:c2}", sortable: { compare: function (a, b) { x = kendo.parsefloat(a); y = kendo.parsefloat(b); if (isnan(x) || x === null) { x = 0; } if (isnan(y) || y === null) { y = 0; } alert('x = ' + x + '; ' + 'y = ' + y); homecoming (x === y ? 0 : ((x > y) ? 1 : -1)); } } }

i have jsfiddle set demonstrate behavior located here.

this question not provide answer.

thanks.

you have reference field want sort by. example, firstname.

sortable: { compare: function (a, b) { homecoming (a.firstname === b.firstname ? 0 : ((a.firstname > b.firstname) ? 1 : -1)); } }

i think didn't have references kendo , jquery right in fiddle. seek one: http://jsfiddle.net/yb3g2/

kendo-ui grid sortable

No comments:

Post a Comment