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

Pages: [1]
1
Help for ParamQuery Pro / Check Grid Validation before calling a Saving
« on: January 19, 2016, 10:23:56 am »
I am trying to check that there are no validation errors in the grid before I call ajax to save the data.  Even when the grid has a triangle in a cell and is aware there is a validation error the below .pqGrid("isValid", { rowData: rowData }) evaluates true.  What am I missing?

 var errosWithData = TargetToolDataGrid.isValid($("#grid_Top"));
        if (errosWithData == -1) {
            alert("There is nothing to save.");
        } else if (errosWithData > 0) {
            alert("There are invalid entries on row "+errosWithData+". Look for cells with a triangle in the upper right corner.");
        }


var TargetToolDataGrid = {
    isValid: function (gridToCheck) {
        debugger;
        var dataModelMgr = gridToCheck.pqGrid("option", "dataModel");
        var dataMgr = dataModelMgr.data;

        if (dataMgr.length > 0) {
            for (var i = 0, len = dataMgr.length; i < len; i++) {
                var rowData = gridToCheck.pqGrid("getRowData", { rowIndx: i });
                if (!gridToCheck.pqGrid("isValid", { rowData: rowData })) {
                    return i; //row with error
                }
            }
            return 0;  // zero errors
        }
        return -1; //no data
    }
}
 

2
Help for ParamQuery Pro / Re: getdata from grid
« on: November 23, 2015, 07:46:36 pm »
I got it to work.   Thanks for your help

//SOLUTION
var row1Data = $("#grid_Top").pqGrid("getRowData", { rowIndx: 0 });
var repname = row1Data.REP_NAME;
$("#reptop").text(repname);

3
Thanks for the response.  This issue was tracked down to be unrelated to PQGrid.  I was switching data models and db connections in the controller that was returning  values back to pqgrid.

4
Help for ParamQuery Pro / Re: getdata from grid
« on: November 23, 2015, 06:53:50 pm »
That makes sense.  I see where I was using the column name Name and not the dataIndex: REP_NAME.  But when I add the below lines I still can't access the value of a cell.

var repname = $("#grid_Top").pqGrid("getCell", { rowIndx: 0, dataIndx: "REP_NAME" });
 alert("rename="+repname); // this gives me an alert box message  repname=[object Object]
               
 var rowData = $("#grid_Top").pqGrid("getRowData", { rowIndx: 0 });
 var cellData = rowData.REP_NAME;
 alert("cellData=", cellData);   //this gives me an alert box message cellData=

I have attached my cshtml file.


5
Help for ParamQuery Pro / getdata from grid
« on: November 23, 2015, 12:35:20 pm »
I can load grids fine using c# mvc but when I use the calls to getData, getRowData etc... I can't get an array as the documentation suggests. I create my grids like this:

        var colModel = [
        {
            title: "Name", //title of column.
            width: 65, //initial width of column
            editable: false,
            dataType: "string", //data type of column
            dataIndx: "REP_NAME" //should match one of the keys in row data.
        }

        var dataModelTop = {
            location: "remote",
            sorting: "local",
            sortIndx: "CHARGE_TYPE_DESC",
            sortDir: "up",
            dataType: "JSON",
            method: "GET",
            getUrl: function () {
                return { url: Url4controller };
            },
            getData: function (response) {
                return { data: response };
            }


        }

var grid_Top = pq.grid("#grid_Top", objTop);
var totalRecordsTop = $("#grid_Top").pqGrid('option', 'dataModel.data').length;  //this works

//I want to access the first row of a column named Name of a refreshed grid to populate eleswhere on my webpage
var datafrmgrid = $("#grid_Top").pqGrid( "getCell", { rowIndx: 0, dataIndx: "Name" } );  //does not work.

Please help




6
Help for ParamQuery Pro / Re: Upgrage from Pro Eval to Pro
« on: November 23, 2015, 11:16:09 am »
That worked Thanks

7
I am trying to run 2 grids on the same page which uses the same column model but different data models.  If the data models are blank everything works and if I use the same data model for both it works but, when I populate the second grid with a different data model it does not show the updated results or worse throws an error code "Unhandled exception at line 135, column 160 in pqgrid.js.  Can pqgrid use independent data models on the same page and if so is there an example?
 

8
Help for ParamQuery Pro / Upgrage from Pro Eval to Pro
« on: November 09, 2015, 10:51:23 pm »
I purchaed PraramQuery Pro SDK and recived an email with a zup file attachment however, when I replace the css and js file in my Visual Studio 2013 project I still see the ParamQuery Pro Eval link in the lower right corner when I run the web appliation.  What do now that I am a Licensed customer to remove the eval link?

Transaction ID: xxxxxxxxx842H

Pages: [1]