Author Topic: Few Columns should have text box (editable textbox on loading) by default  (Read 4254 times)

AN00372424

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi Team,

Using Param Query is there any possibility to make few columns of all the rows as editable text box field on loading.

Thanks in Advance.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #1 on: November 16, 2017, 04:03:48 pm »
All the fields are editable text box by default.

To make only few of them as editable, add editable: false in the columnTemplate and add editable: true in those few columns.

AN00372424

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #2 on: November 16, 2017, 04:34:42 pm »
The columns are editable by default. Yes I agree this. But the text box (Editable text box) will be available only if we double click on the field. But in our requirement by default, that text box should be available for all the rows for a particular column.

I have attached two screenshots.

In one image, none of the columns will have editable text box.
In another image, one column with value 8 will have editable text box.

My requirement is, by default all those columns should have that editable text box (without double clicking on it).


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #3 on: November 17, 2017, 10:38:55 am »
There can be only one editor active at a time in the grid.

You could use singleclick (editModel.clicksToEdit = 1) instead of double click to activate the cell editor if that helps.

AN00372424

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #4 on: November 17, 2017, 12:44:07 pm »
Thank you for the information.

Is there any way to add custom text box using Angular JS in Param Query Grid to meet our requirements? 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #5 on: November 17, 2017, 05:17:12 pm »
Yet there is another way to do it with column.render

Code: [Select]
render: function(ui){
      return "<input type='text' style='width:100%;' value=\""+ui.cellData+"\"/>";
 }

http://jsfiddle.net/rnmw460k/

AN00372424

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #6 on: November 20, 2017, 01:44:04 pm »
Thank you very much. It works.

But if i change the data, it is not getting reflected.

Eg: In the text box the current value is 25. I am changing the value to 35 in the screen. But am getting the same old value 25 in the scope.gridOptions.dataModel.data.

In the example you've mentioned earlier, there was not any save functionality. Is there any way to capture those modified data to the dataModel.data object.

I tried using css selector 'id'. But if i go to the next page in the data grid pagination, the modified data is getting lost.

Kindly give me your suggestions on this topic.
« Last Edit: November 20, 2017, 02:04:18 pm by AN00372424 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Few Columns should have text box (editable textbox on loading) by default
« Reply #7 on: November 20, 2017, 02:48:10 pm »
You have to enter or focus out of the cell in order to save it.