Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - atkingtornado

Pages: [1]
1
Thank you for your reply!

When I try to print out dataModel.data to the console... for some reason It's not retrieving the data as it should. Here's my code:

$(document).ready(function(){
      
   var colM = [{ title: "DQPR", width: 100, dataType: "string", dataIndx: "dqpr" },
                  { title: "Status", width: 200, dataType: "string", dataIndx: "status" },
                  { title: "First Name", width: 200, dataType: "string", dataIndx: "firstName" },
                  { title: "Last Name", width: 200, dataType: "string", dataIndx: "lastName" }                                 
            ];
   

   var dataModel = {
       location: "remote",
      sorting: "local",
      paging: "local",
      dataType: "JSON",
      method: "GET",
      sortIndx: "dqpr",
      sortDir: "up",
      getUrl: function () {
         return{ url: "cgi-bin/get_json.py"}
      },
      getData: function (dataJSON) {
         var data = dataJSON.data;
         return { data: dataJSON.data };
      }
   };
   
   var newObj = {
      flexHeight: true,
      flexWidth: true,
      dataModel: dataModel,
      bottomVisible: true,
      colModel: colM,
      selectionModel: { mode: 'single' },
      editable: false,
      scrollModel: { horizontal: false },
      title: "DQPR Data",
      columnBorders: true
   };
   var $grid = $("#grid_json").pqGrid(newObj);
   console.log(JSON.stringify(dataModel.data));

});

2
I am trying to save data to a remote location using paramquery, I am reading the JSON file with a python script and then passing that data to paramquery. The location on the webserver where the code is located is not writable from the web, hence the need for a custom function. IS there a way to get the data from the grid and then send it back out to the remote location?

Thanks!

Pages: [1]