Author Topic: different cells has different editor  (Read 2044 times)

arquehi

  • Newbie
  • *
  • Posts: 1
    • View Profile
different cells has different editor
« on: April 15, 2015, 11:28:23 am »
hello param,
  i have a problem that want to different cells has different editor.

 my grid have kind of editor in the rows, or not in the columns. my grid have ten rows and 5 columns.
     my grid demand to select editor in the first three lines, but the editor options is different. And demand to text editor in the five lines, the last two lines with datepicker . so what can i do

so what can i do?
thanks
« Last Edit: April 16, 2015, 09:29:45 am by paramquery »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: different cells has different editor
« Reply #1 on: April 16, 2015, 09:33:02 am »
Different editors in different cells within the same column is a rare scenario

however you could use callback variant of the editor to create a custom editor (textbox, select or any other ) based upon ui.rowIndx inside the callback.

column.editor.type = function(ui){
  //implement different editors based upon ui.rowIndx
}

http://paramquery.com/pro/api#option-column-editor
« Last Edit: April 16, 2015, 07:52:48 pm by paramquery »