Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Trying to use the jqGrid function to set all rows to edit. Here is the function.
<script type="text/javascript">
$(document).ready($(function(){
     $("#TimeTracker").jqGrid(
      {
       gridComplete: function(){
           var $this = $(this), ids = $this.jqGrid('getDataIDs'), i, 
           l = ids.length;
           for (i = 0; i < l; i++){
               $this.jqGrid('editRow', ids[i], true;
             }
          }
       });

My Problem is its not able to identify the table as I put a alert in the function and it never gets ran. It throws an error "The specified entity has not been declared". But when I remove this method it loads just not in editmode for all rows like I want. AnyIdeas?
Posted
Comments
ZurdoDev 29-Jul-14 12:55pm    
It sounds like your table does not have the id of TimeTracker.
marine88 29-Jul-14 13:03pm    
Thats what I would have thought also but in looking at the examples it shows it just like mine. @(Html.Grid("TimeTracker")
marine88 29-Jul-14 15:39pm    
I am using the MVCJqGrid library from which also uses the jqGrid library. I did set the rows to editable before but it did no good as it can't seem to find the name of the grid to iterate all the rows IDs. I would post the cshtml code but I have to work off a vm and its a pain to retype it all.

1 solution

Hi

For implementing edit functionality in JQgrid we have to set editable property to true in JQgrid column model.

Eg.

SQL
colModel: [
            { key: true, hidden: true, name: 'Id', index: 'Id', editable: false},
            { key: false, name: 'TaskName', index: 'TaskName', editable: true },
            { key: false, name: 'TaskDescription', index: 'TaskDescription', editable: true },


Here in this example Id column will be not editable, but
Task name and Task Description are editable.

Also For Your Reference you can refer my blog.I have created sample application demo on JQGrid MVC.

http://dotnetsourcedileep.blogspot.in/2014/06/test.html[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900