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 - sudo

Pages: [1]
1
So is there any method that returns JUST the DATA and not the state or other "pq_" object?

2
I'm try to retrieve the row data to update the record on server.  When executing this:  var rowData = studyGrid.pqGrid("getRowData", {rowIndx: currentRow});  The rowData has an pq_cellselect object in it...  which I have to remove before sending to server.  Why is pq_cellselect part of the data returned for a Row?  You can see in the image of a screen shot of the debugger screen what I'm talking about.  Thanks for your help.

3
I upgrade from 2.0.4 to 2.3.0 cause and now when I click in a cell to edit the editing jumps to bottom outside of grid.

4
Help for ParamQuery Pro / Re: Error on getData call
« on: May 15, 2014, 01:55:51 am »
I found the error....  came from another table being updated simultaneous.   :) :D

5
Help for ParamQuery Pro / Re: Error on getData call
« on: May 15, 2014, 01:26:04 am »
After digging in pqgrid.dev.js to locate error...... 

So the error gets thrown here...  line 2895 of pqgrid.dev.js :

         error: function(jqXHR, textStatus, errorThrown) {
            that.hideLoading();
            that.loading = false;
            if (typeof DM.error == "function") {
               DM.error.call(that.element, jqXHR, textStatus, errorThrown)
            } else {
               if (errorThrown != "abort") {
                  throw ("Error : " + errorThrown)  // error thrown here
               }
            }


but what is interesting is that the data does get processed with no errors after that in this previous part (line 2847 - 2887) of the pqgrid.dev.js

         success: function(responseObj, textStatus, jqXHR) {
            if (typeof DM.getData == "function") {
               var retObj = DM.getData.call(that.element, responseObj, textStatus, jqXHR);
               DM.data = retObj.data;
               if (PM.type && PM.type == "remote") {
                  if (retObj.curPage) {
                     PM.curPage = retObj.curPage
                  }
                  if (retObj.totalRecords) {
                     PM.totalRecords = retObj.totalRecords
                  }
               }
            } else {
               DM.data = responseObj.data;
               if (PM.type && PM.type == "remote") {
                  if (responseObj.curPage) {
                     PM.curPage = responseObj.curPage
                  }
                  if (responseObj.totalRecords) {
                     PM.totalRecords = responseObj.totalRecords
                  }
               }
            }
            that.hideLoading();
            that.loading = false;
            that._trigger("load", null, {
               dataModel: DM,
               colModel: thisColModel
            });
            if (raiseFilterEvent) {
               that._trigger("filter", null, {
                  type: "remote",
                  dataModel: DM,
                  colModel: thisColModel,
                  filterModel: FM
               })
            }
            if (objP && objP.callback) {
               objP.callback()
            }
         },



and my grip gets updated.   Any ideas on what's going on?

6
Help for ParamQuery Pro / Error on getData call
« on: May 15, 2014, 12:15:52 am »
I'm getting this error (apparently from the data back) :
Uncaught Error : SyntaxError: Unexpected token < pqgrid.min.js:9
g.remoteRequest.xhr.h.ajax.error pqgrid.min.js:9
jQuery.Callbacks.fire jquery-1.10.2.js:3048
jQuery.Callbacks.self.fireWith jquery-1.10.2.js:3160
done jquery-1.10.2.js:8237
jQuery.ajaxTransport.send.callback jquery-1.10.2.js:8778

So the table is populating correctly, just seeing the error in the console (debugger)

Here is the data back from the PHP....  captured with debugger in PHP - I validated here http://jsonlint.com/:


{"data":[{"id_studies":"12","country":"usa","study_name":"O34232","category_table":"Healthy","summary_table":"D-alanine mouthrinse medication","gender_table":"Male, Female","age_table":"18 - 30","compensation_table":"Volunteer - $3,300; Partner - $1,200","length_table":"Volunteer 13 overnights and 4 follow up; Partner 4 follow up appointments","qualifications":"Males, Age: 18-30, BMI:18-32, No children living at home, You must be a non-smoker","minimum_age":"18","maximum_age":"30","status":"","study_details":"<p><strong>Category<\/strong><\/p>\r\n<p>Healthy<\/p>\r\n<p><strong>Description<\/strong><br \/>\r\n<\/p>\r\n<ul>\r\n<li>You must be available for 13 clinical overnight stays, plus 4 follow-up visits<\/li>\r\n  <li>You must be in a committed relationship<\/li>\r\n  <li>Your partner must be available for 4 follow-up visits<\/li>\r\n<\/ul>\r\n<p><strong>Qualifications<\/strong><br \/>\r\n<\/p>\r\n<ul>\r\n  <li>Males<\/li>\r\n  <li>Age: 18-30<\/li>\r\n  <li>BMI:18-32<\/li>\r\n  <li>No children living at home<\/li>\r\n  <li>You must be a non-smoker<\/li>\r\n<\/ul>\r\n<p><strong>Age<\/strong><br \/>\r\n  18 - 30<\/p>\r\n<p><strong>Duration<\/strong><br \/>\r\n  Volunteer 13 overnights and 4 follow up; Partner 4 follow up appointments<\/p>\r\n<p><strong>Reimbursement<\/strong><br \/>\r\n  You may be compensated for time\/travel up to $3,300 for male treated subjects; $1,200 for their partner. Refer a qualified subject for this study receive $500.<\/p>\r\n","sort_order":null}] }


PHP Code: 
        echo "{\"data\":". json_encode( $rows ) ." }" ;




dataModel:

        studyObjTbl.dataModel = {
            dataType: 'JSON',
            location: "remote",
            method: 'POST',
            sorting: "local",
            sortIndx: "id_studies",
            sortDir: "up",
            url: 'php/TransactionHandler.php?transActionID=listStudies&team=USA',
            getData: function (response, textStatus, jqXHR) {
                return { data: response.data };
            }
        };


Any insight?  Thanks

7
Help for ParamQuery Pro / Re: Refresh Not working
« on: May 14, 2014, 01:50:03 am »
So without the quotes - this error get thrown:  Uncaught ReferenceError: newdataModel is not defined -  Here the whole thread:

Uncaught ReferenceError: newdataModel is not defined StudyGrid.js:204
StudyGrid.loadData StudyGrid.js:204
$.selectable.selected index.html:173
$.Widget._trigger jquery-ui-1.10.4.js:785
(anonymous function) jquery-ui-1.10.4.js:11356
jQuery.extend.each jquery-1.10.2.js:657
jQuery.fn.jQuery.each jquery-1.10.2.js:266
$.widget._mouseStop jquery-ui-1.10.4.js:11350
(anonymous function) jquery-ui-1.10.4.js:401
$.widget._mouseUp jquery-ui-1.10.4.js:957
(anonymous function) jquery-ui-1.10.4.js:401
_mouseUpDelegate jquery-ui-1.10.4.js:913
jQuery.event.dispatch jquery-1.10.2.js:5095
elemData.handle jquery-1.10.2.js:4766

8
Help for ParamQuery Pro / Re: Refresh Not working
« on: May 14, 2014, 12:42:36 am »
Thanks for the responses.  quotes were left off the dataModel option: $grid.pqGrid( "option", "dataModel", 'newdataModel');

So now another issue has surfaced:  the getData Post does not occur, not sure what is the catalyst for firing that off...  the console.log('getData fired"); Never shows up the console log when this method gets called..  the console.log('Refresh called'); does show up...  so the method is firing.  So what is the catalyst for the firing off the getData?   Should I just move to a ajax request for the data and use it's features to assure it's fired and the data has been returned?

  StudyGrid.prototype.loadData = function (country, teamName) {

        studyObjTbl.dataModel = {
            dataType: 'JSON',
            location: "remote",
            method: 'POST',
            sorting: "local",
            sortIndx: "id_studies",
            sortDir: "up",
            url: 'php/TransactionHandler.php?transActionID=listStudies&country=' + country,
            getData: function (dataJSON) {
                console.log ('getData fired');
                return { data: dataJSON.data };
            }
        };

        studyGrid.pqGrid( "option", "dataModel", 'newdataModel');
        studyGrid.pqGrid( "refreshDataAndView" );
        console.log('Refresh called');

        studyGrid.pqGrid('option', 'title', teamName + ' Studies');

    }

 

9
Help for ParamQuery Pro / Re: Refresh Not working
« on: May 13, 2014, 07:12:02 pm »
Thanks you that worked for data....  but how do you refresh the entire dataModel?  Your API documentation only shows how to set the data in the data in the data model. 
Get or set the dataModel option, after initialization:

//getter
var dataModel=$( ".selector" ).pqGrid( "option", "dataModel" );           
 
//setter
$( ".selector" ).pqGrid( "option", "dataModel", { data: dataSales } );   <= Data not the dataModel





I am using remote data model: 
        obj.dataModel = {
            dataType: 'JSON',
            location: "remote",
            method: 'POST',
            sorting: "local",
            sortIndx: "id_studies",
            sortDir: "up",
            url: 'php/TransactionHandler.php?transActionID=listStudies&country=' + country,
            getData: function (dataJSON) {
                return { data: dataJSON.data };
            }
        };

        // How to set entire datamodel with the new data and the new parameters(sorting, sortDir, etc)?
        ?????? => studyGrid.pqGrid( "option", "dataModel.getData", dataJSON.data );
        studyGrid.pqGrid( "refreshDataAndView" );



10
Help for ParamQuery Pro / Refresh Not working
« on: May 13, 2014, 03:30:25 am »
Here is a skinny sample:  the refresh does not work  - also what version of jquery to use with PRO purchase.  Thanks

Here is the TestRefresh.js Class;
(function (window) {

    // Constructor
    function TestRefresh() {
    }


    TestRefresh.prototype.init = function (dataSet) {

        if (dataSet == 'setone') {
            var title = '';
            var data = [
                [1, 'Exxon Mobil', '339,938.0', '36,130.0'],
                [2, 'Wal-Mart Stores', '315,654.0', '11,231.0'],
                [3, 'Royal Dutch Shell', '306,731.0', '25,311.0'],
                [4, 'BP', '267,600.0', '22,341.0'],
                [5, 'General Motors', '192,604.0', '-10,567.0'],
                [6, 'Chevron', '189,481.0', '14,099.0'],
                [7, 'DaimlerChrysler', '186,106.3', '3,536.3'],
                [8, 'Toyota Motor', '185,805.0', '12,119.6'],
                [9, 'Ford Motor', '177,210.0', '2,024.0'],
                [10, 'ConocoPhillips', '166,683.0', '13,529.0'],
                [11, 'General Electric', '157,153.0', '16,353.0'],
                [12, 'Total', '152,360.7', '15,250.0'],
                [13, 'ING Group', '138,235.3', '8,958.9'],
                [14, 'Citigroup', '131,045.0', '24,589.0'],
                [15, 'AXA', '129,839.2', '5,186.5'],
                [16, 'Allianz', '121,406.0', '5,442.4'],
                [17, 'Volkswagen', '118,376.6', '1,391.7'],
                [18, 'Fortis', '112,351.4', '4,896.3'],
                [19, 'Crédit Agricole', '110,764.6', '7,434.3'],
                [20, 'American Intl. Group', '108,905.0', '10,477.0']
            ];
            title = "Data Set One"

        }

        if (dataSet == 'settwo') {

            var data = [
                [1, 'Go Mobil', '339,938.0', '36,130.0'],
                [2, 'Lowes Stores', '315,654.0', '11,231.0'],
                [3, 'Shell Gas', '306,731.0', '25,311.0'],
                [4, 'BP Me Please', '267,600.0', '22,341.0'],
                [5, 'Specific Motors', '192,604.0', '-10,567.0'],
                [6, 'Peter Pan', '189,481.0', '14,099.0'],
                [7, 'never a Chrysler', '186,106.3', '3,536.3'],
                [8, 'Toyota Fails again', '185,805.0', '12,119.6'],
                [9, 'Ford Motor', '177,210.0', '2,024.0'],
                [10, 'American Intl. Group', '108,905.0', '10,477.0']
            ];
            title = "Data Set Two"

        }


        var obj = { width: 700, height: 300,
            title: title,
            numberCell: {resizable: true, title: "#"},
            editable: false,
            flexWidth: true,
            showBottom: false,
            resizable: true };
        obj.colModel = [
            { title: "Rank", width: 100, dataType: "integer" },
            { title: "Company", width: 200, dataType: "string" },
            { title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
            { title: "Profits ($ millions)", width: 150, dataType: "float", align: "right" }
        ];
        obj.dataModel = { data: data };

        var $grid = $("#grid_array").pqGrid(obj);
        $grid.pqGrid('refresh');

    }

    // Expose the class to the window
    window.TestRefresh = TestRefresh;


})(window);



And here is the HTML:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" media="all" href="../css/pqgrid.min.css">
    <title></title>
    <script src="jquery-1.10.2.js"></script>
    <script src="jquery-ui-1.10.4.js"></script>
    <script src="pqgrid.min.js"></script>
    <script src="TestRefresh.js"></script>

    <script>
        var testRefresh = new TestRefresh();
        function init() {
            testRefresh.init('setone');
        }

        function loadSetOne() {
            testRefresh.init('setone');
        }


        function loadSetTwo() {
            testRefresh.init('settwo');
        }


    </script>


</head>
<body onload="init()">
<div id="grid_array" style="margin:auto;"></div>
<a href="#" onclick="loadSetOne();" >Load Set One</a>
<a href="#" onclick="loadSetTwo();" >Load Set Two</a>
</body>
</html>

11
Help for ParamQuery Pro / Fluid Width Table
« on: April 28, 2014, 11:00:28 pm »
So how does one go about setting a fluid width for a table....  the parameter for the width seems to be only in px.  I need em or %.  Also noticed this when the js generates the tables html:
<div id="study_table" class="pq-grid ui-widget ui-widget-content ui-corner-all ui-resizable" style="width: 1178px;">.......</div>
the width(width: 1178px;) is set for the table directly inline and not accessible?

12
How can I confirm saving a change on a cell edit once they have clicked out of that cell.  Tried this to no avail:

    grid.on("pqgridquiteditmode", function (evt, ui) {
        //exclude esc and tab
        if (evt.keyCode != $.ui.keyCode.ESCAPE && evt.keyCode != $.ui.keyCode.TAB) {
            saveChange();
        }
    });

    // dialog for saving the changes
    function saveChange() {
        $("#dialog-confirm-save").dialog({
            resizable: false,
            height: 140,
            modal: true,
            buttons: {
                "Save Changes": function () {
                    grid.pqGrid("saveEditCell");
                    $(this).dialog("close");
                },
                Cancel: function () {
                    grid.pqGrid('quitEditMode');
                    $(this).dialog("close");
                }
            }
        });
    }


 

Pages: [1]