PDA

View Full Version : How to sort Datagrid with Item render


samsonkiran
02-11-2009, 06:34 PM
Hi

I have datagrid which has a Button as an item renderer. This button will be displayed based on few data in the datagrid. So it will be visible for the all the rows. When i first load the datagrid the buttons are appearing in the appropriate rows. But when i click on any column header to Sort the datagrid then buttons are appearing in different row. So how do i make sure that the button gets displayed in the proper row when the Datagrid sorted or scolled.

Thanks

wvxvw
02-11-2009, 08:59 PM
Not sure I follow your question... but, why enable sorting if you don't want columns to be sorted? Or, do you want the buttons separately from the rest of the columns? then why do you put them into DG?

sipra
02-12-2009, 07:47 AM
As I understand your problem,when you sort the other column the button column are not in proper way as loading time have.But in general we know the sorting having with a particular column and the other columns are arranging with the sorted column.So I think it is not a problem.I think you disable the sorting for every column.So you got the button column in proper way all time.
If you want to sort the button column you can use the sortCompareFunction.But i don't know what the button value return.Could you post the code of that particular column?

Peter Cowling
02-12-2009, 12:29 PM
For the datagridcolumn that contains the button, add an additional property: sortable="false".