Categories | Question details Back To List | ||
Grid Hi, custom sorting for the integer links is not working, i mean its ordering sequence is not correct this is the following code for the custom sort function sort_custom(a,b,order){ //alert(mygrid.cells(id,0).getValue()); //the name of the function must be > than 5 chars a = a.replace(/\<a.*?\>/,"").replace("</a>",""); b = b.replace(/\<a.*?\>/,"").replace("</a>",""); return (parseInt(a)> parseInt(b)?1:-1)*(order=="asc"?1:-1) } Answer posted by Support on Oct 31, 2008 10:00 Please try to use function sort_custom(a,b,order){ //alert(mygrid.cells(id,0).getValue()); //the name of the function must be > than 5 chars a = a.replace(/<[^>]*>/g,""); b = b.replace(/<[^>]*>/g,""); return (parseInt(a)> parseInt(b)?1:-1)*(order=="asc"?1:-1) } |