Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9273605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:09:14+00:00 2026-06-18T16:09:14+00:00

I am able to populate a grid as well as perform update, both via

  • 0

I am able to populate a grid as well as perform update, both via a php call to server. I cannot seem to construct a grid that does both. In the code below, I have both url and editurl. Both point to the same php page, but I think this is necessary. On the php page, I am collecting the contents of the cells via POST and printing them to a file. I know this code is accurate because it works when I use it with a grid that only saves data and doesn’t attempt to populate with a php server call. Being fairly new to JQGrid, I’m not sure how data is saved and sent. Also note that I had to use datatype: ‘local’ to save the data, but I have to use datatype: ‘xml’ to populate the grid. Perhaps this is the problem?

$("#list").jqGrid({
url:'functions.php',
datatype:'xml',
mtype:'POST',
colNames:['Label','Account_Num','Amount', 'Type Code', 'Record Code', 'Sequence','Actions'],
colModel :[
{name:'label', index:'label', width:150, align:'center', sortable:false, editable:true},
{name:'cntrct_id', index:'cntrct_id', width:150, align:'center', sortable:true},
{name:'amount', index:'amount', width:150, align:'center', sortable:false, editable:true},
{name:'type_cd', index:'type_cd', width:150, align:'center', sortable:false, editable:true},
{name:'rec_cd', index:'rec_cd', width:150, align:'center', sortable:false},
{name:'db_seq', index:'db_seq', width:150, align:'center', sortable:false},
{   name:'actions',
classes:'jg_actions',
formatter:"actions",
editable:false,
sortable:false,
resizable:false,
fixed:true,
width:120,
formatoptions:{
    keys:true,
    delbutton:true,
    onSuccess: function(response){

    },
},
},
],
editurl: 'functions.php',
postData: { 
action:'popGrid', 
sqlCount:sqlCount, 
sqlSelect:sqlSelect, 
sqlSelect2:sqlSelect2, 
label1:label1, 
label2:label2,},
onSelectRow: function(id){
    if(id && id!==lastSel){
        jQuery('#list').restoreRow(lastSel);
    jQuery('#list').editRow(id,true);
    lastSel=id;
    }
},

pager: '#pager',
rowNum:100,
rowList:[100,200,300,400,500,600,700,800,900,1000],
sortname: 'cntrct_id',
sortorder: 'desc',
viewrecords: true,
caption: 'Adjustments'
}); 


<?php

$label = $_POST['label'];
$cntrct_id = $_POST['cntrct_id'];
$amount = $_POST['amount'];
$type_cd = $_POST['type_cd'];
$rec_cd = $_POST['rec_cd'];
$db_seq = $_POST['db_seq'];
$myfile = "text.txt";
$fh = fopen($myfile,'a');
fwrite($fh,$label.' '.$cntrct_id.' '.$amount.' '.$type_cd.' '.$rec_cd.' '.$db_seq);
fclose($fh);


?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:09:15+00:00Added an answer on June 18, 2026 at 4:09 pm

    I think you are confused on XML vs Local datatypes. What the datatype specifies is where the data to feed the grid will come from. Local means that you are providing a variable that has data in it from some other portion on the client side where XML means that you will provide XML formatted data from a URL. (Server side process)

    You should be able to use Firebug/Chrome to see the data your grid sends out after an update, the format it is in and where it is going. After your edit, the post to your functions.php your grid should reload with that reload reflecting the changes to your dataset from your edit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to define a class that is able to populate itself reading from
In Dojo 1.3 I was able to populate dojox.grid.DataGrid's cell with an <a href>
Im able to populate my formset with the elements of an array which is
I recently have just been able to populate my core data DB. I have
I have a grid that populates from a search event and I'd like the
I have succesfully able to populate the my storage extension table using my custom
I have two queries that I want to be able to run on a
I am able to populate my select list boxes per guidance from http://learn.knockoutjs.com/#/?tutorial=collections .
I am trying to populate drop down from mysql table. I am able to
Would like to be able to populate any properties of an object and search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.