Author Topic: Columns become non-editable after grid data reload  (Read 3107 times)

yulia

  • Newbie
  • *
  • Posts: 2
    • View Profile
Columns become non-editable after grid data reload
« on: March 27, 2014, 11:30:59 pm »
I'm using dataModel = 'local' and loading data manually. When I reassign pqGrid, the columns that were editable on initial load are no more editable.

If I destroy pqgrid before 2nd load, it fixed the problem, but sometimes I don't know if pqgrid is already loaded (and if it's not and I call destroy, and error occurs). I tried to see if there's an API that will tell me fi the grid is loaded and couldn't find anything.

Here's my code.

    var dataSource = dataArray;
    var obj = {};
   obj.width = 1000;
   // obj.height = 400;
   columnModel = [     
      {title:"SeedWeightID", hidden:true},
       {title:"Plant", width:150, dataType:"float", align:"right", className:'grid-col', editable: false},
       {title:"", width:350, dataType:"float", className:'grid-col', editable: false},
       {title:"", width:150, dataType:"float", className:'grid-col', editable: true},
       {title:"", width:150, dataType:"string", className:'grid-col'},
       {title:"", width:150, dataType:"string", className:'grid-col'}
       ];
   dataModelSource = {data: dataSource};
   $( "#grid_array" ).pqGrid(
          {scrollModel:{pace: 'fast', horizontal: false} },
          {editModel:  {saveKey: 13}},
          {editable: true},
          {flexWidth: true} ,   
          {flexHeight:true},
          {colModel: columnModel},
          {dataModel: dataModelSource},      
              obj );

Any suggestions?



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Columns become non-editable after grid data reload
« Reply #1 on: March 27, 2014, 11:40:36 pm »
pqGrid constructor accepts only one argument object, but you are trying to pass number of different objects to it.

yulia

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Columns become non-editable after grid data reload
« Reply #2 on: March 27, 2014, 11:50:01 pm »
Oh, I didn't realize that! Thank you so much for pointing it out, it did solve the problem!