Forum

July 12th, 2025
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
help me please. Unable to edit rows :(
22/04/2012
10:10
Avatar
abdol
Member
Members
Forum Posts: 5
Member Since:
22/04/2012
sp_UserOfflineSmall Offline

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>

23/04/2012
05:10
Avatar
abdol
Member
Members
Forum Posts: 5
Member Since:
22/04/2012
sp_UserOfflineSmall Offline

I solved it. I should have add cellEdit: true

Thanks.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information