Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






help me please. Unable to edit rows :(

No Tags
UserPost

10:10
22/04/2012


abdol

Member

posts 5

Post edited 10:11 – 22/04/2012 by abdol
Post edited 10:18 – 22/04/2012 by abdol


Hi every one,

I am new to javascript. I tried the inline edit example but it seems wahtever i do, It's not working for me.

The table displays correctly and I can click on every single element. but I can't edit rows. I get the

following message in firebug:

"a.type is not a function"

Here is my file:


<!--Setting browser's tab title-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--Setting html page content-->

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>Online Tracking</title><link href="/css/site.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/ui-lightness/jquery-ui-1.8.19.custom.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/ui.jqgrid.css" media="screen" rel="stylesheet" type="text/css" /><!--        <style>
            html,body{
                margin: 0;
                padding: 0;
                font-size: 75%;
            }
        </style>-->
        
<script type="text/javascript" src="http://ajax.googleapis.com/aja.....ery.min.js"></script>

<script type="text/javascript" src="/js/i18n/grid.locale-en.js"></script>
<script type="text/javascript" src="/js/jquery.jqGrid.min.js"></script>      
    </head>
 
    <body> 
<!--        Zonload="showValues()">-->
<!--        <div>
            <h1></h1>
        </div>-->
        
        <div>
            <script type="text/javascript">
jQuery(document).ready(function(){ 
  var lastsel2
  jQuery("#rowed5").jqGrid({        
    datatype: "local",
    height: 250,
    colNames:['ID Number','Name', 'Stock', 'Ship via','Notes'],
    colModel:[
      {name:'id',index:'id', width:90, sorttype:"int", editable: true},
      {name:'name',index:'name', width:150,editable: true, editoptions:{size:"20",maxlength:"30"}},
      {name:'stock',index:'stock', width:60, editable: true, edittype:"checkbox",editoptions: {value:"Yes:No"}},
      {name:'ship',index:'ship', width:90, editable: true, edittype:"select", editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}},                       
      {name:'note',index:'note', width:200, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"10"}}                      
              ],
    onSelectRow: function(id){
      if(id && id!==lastsel2){
        jQuery('#rowed5').restoreRow(lastsel2);
        jQuery('#rowed5').editRow(id,true);
          lastsel2=id;
      }
    },
    editurl: "server.php",
    caption: "Input Types"
  });
  var mydata2 = [
    {id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx"},
    {id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime"},
    {id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT"},
    {id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX"},
    {id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx"},
    {id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx"},
    {id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX"},
    {id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT"},
    {id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx"}
    ];
  for(var i=0;i<mydata2.length;i++)
    jQuery("#rowed5").addRowData(mydata2[i].id,mydata2[i]);
});
</script>

<table id="rowed5" class="scroll"></table><br />
<b>Notice</b>:  Undefined variable: id in <b>/Users/abdol/Desktop/local.test/dev2/application/forms/SupervisorApproval.php</b> on line <b>18</b><br />
        </div>
    </body>
</html>

05:10
23/04/2012


abdol

Member

posts 5

I solved it. I should have add cellEdit: true

Thanks.

No Tags

About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

27 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9596

Posts: 28792

Membership:

There are 10195 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7010 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information