Click here to Skip to main content
12,556,142 members (54,760 online)
Rate this:
Please Sign up or sign in to vote.
See more: PHP MySQL jQuery JQGrid
I am trying to have a jqgrid on my webpage with all the functionality. Currently I am able to fill the grid with data from mysql database. Now I have kept add:true in the navgrid option and with the '+' icon it opens a add dialog box with 3 fields which on submit I need to add to mysql database. Here's my jqgrid code:
<pre lang="Javascript">
<script type="text/javascript">
   // data: mydata,
    datatype: 'json',
    mtype: 'POST',
    url: 'showResources.php',
    width: 700,
    {name:'lab_name', index:'lab_name', width:40,editable:true, edittype: 'select', editoptions:{value:"nccs:NCCS;tcs:TCS;iisc:IISC;icgeb:ICGEB", dataInit:             function(elem)
    {name:'resource_name', index:'resource_name', width:50,editable:true, editoptions:{size:'auto'}},
    {name:'description', index:'description', width:100,editable:true, edittype: 'textarea', editoptions:{rows:"2",cols:"20"}},
    pager: "#pager",
    rownumbers: true,
    gridview: true,
    sortname: 'id',
    viewrecords: true,
    loadonce: true,
    sortorder: "desc",
    height: 250,
    editurl: 'addResource.php'
    }).navGrid('#pager',{edit:false,add:true,del:false,search:true},{width: '330', closeAfterAdd: true });
Posted 28-Nov-12 20:12pm

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 29 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100