We've been working on protoyping an application and would like to allow the user to have maximum flexibility to hide/unhide columns and perhaps reorder columns. I'm going to call this column manipulation.
We started out by using columnTemplates to format columns and column manipulation presented no issue.
However, we also want to be able to mark the entire row of the grid (i.e. when the item the row represents becomes "used") by assigning the whole row a CSS class or style (e.g. "opacity:0.30"), so we switched to a row template so that we could create the <tr> element and set its class according to a data value. We also created an alternate row template that differs only by adding the k-alt class. Works well.
However, if we allow the column menu to manipulate the list of columns, the rowTemplate (coded to expect a particular list of columns in a certain order) has a bit of an issue.
Do you have a suggestion for how to handle the whole-row decoration without using a row Template, or how to write a rowTemplate that is aware of the column manipulation?
In a somewhat related vein, is there an easy way for a columnTemplate to know what column it has been summoned forth to format? Say I want to use the same exact template for 2 (or more) columns. However, the columnTemplate is passed the entire model, not just the column to be formatted. No problem for a columnTemplate that only handles one column, but an issue for one that doesn't know which of the columns it should format data from.
We started out by using columnTemplates to format columns and column manipulation presented no issue.
However, we also want to be able to mark the entire row of the grid (i.e. when the item the row represents becomes "used") by assigning the whole row a CSS class or style (e.g. "opacity:0.30"), so we switched to a row template so that we could create the <tr> element and set its class according to a data value. We also created an alternate row template that differs only by adding the k-alt class. Works well.
However, if we allow the column menu to manipulate the list of columns, the rowTemplate (coded to expect a particular list of columns in a certain order) has a bit of an issue.
Do you have a suggestion for how to handle the whole-row decoration without using a row Template, or how to write a rowTemplate that is aware of the column manipulation?
In a somewhat related vein, is there an easy way for a columnTemplate to know what column it has been summoned forth to format? Say I want to use the same exact template for 2 (or more) columns. However, the columnTemplate is passed the entire model, not just the column to be formatted. No problem for a columnTemplate that only handles one column, but an issue for one that doesn't know which of the columns it should format data from.