Is it possible in slickgrid to add the editors by row rather then column? if so how is it done?
Asked
Active
Viewed 1,644 times
0
-
Sorry, but why would you want to do that? – ganeshk Jul 25 '12 at 14:09
-
well my columns are dynamically created by the user via 2 dates a start and and end. Then down the Left hand side i have some repeating headers, Name, Availability to name a few, and for say availability i want a check box editor ,but for name I want the editor to be text. – chris Jul 25 '12 at 14:34
-
So, it is still editors per column, right? Even if the columns are added dynamically, you can attach an editor to the column definition before it is set in the grid. – ganeshk Jul 25 '12 at 14:43
-
Not quite as say under one column I would have a Name that I want to be a text, then on the row below availability that should be a checkbox, below car type say that I want to be a drop down.(this would be repeated across the columns). Hence why I was wondering if there was a row editor. – chris Jul 25 '12 at 14:55
-
1I don't think SlickGrid supports this by default. But you can achieve this I think. You could intercept the init of the column-editor defined and initialize the kind of element you want for that row and column. For example, check if the row contains a column with value 'Name', then init() in the editor would return a textbox - and if the row contains a column with value 'Availability', then init() returns a checkbox. You will need to do this in slick.editors.js - you could either edit an existing editor or write your own. Check this for how to write a custom editor - http://goo.gl/MkEXW – ganeshk Jul 25 '12 at 15:11
1 Answers
1
You can implement getItemMetadata(row)
and specify an editor in there. See https://github.com/mleibman/SlickGrid/wiki/Providing-data-to-the-grid.

Tin
- 9,082
- 2
- 34
- 32