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

Pages: [1]
1
Help for ParamQuery Pro / Filter not working after Ajax Call
« on: December 22, 2015, 12:54:34 pm »
Hello,

I trying to use Header filtering. If I bring the data using spaghetti code and insert it into pqgrid at time of grid declaration, the filter works fine. However, if I bring the data using an Ajax call and insert it into the datamodel later, the filter is not working. In this case data is set as []; at time of grid declaration. Am I missing any refresh for the filter? I am using 2.0.4 version.

Please find below my code of the ajax call:
Code: [Select]
        $.ajax({
            type: "POST",
            url: "F1910.aspx/bindGrid1",
            data: '{"apprlvl":"' + appr + '"}',
            processData: false,
            contentType: "application/json",
            dataType: "json",
            async: true,
            cache: false,
            success: function (msg) {
                var obj = eval(msg.d);
                $("#grid_json").pqGrid("option", "dataModel", { data: obj, sorting: "local",sortIndx: ["uckalerts","pono", "posrno"], sortDir: ["down","up","up"]});
               
                $("#grid_json").pqGrid("refreshDataAndView");
            },
            error: function (x, e) {
                alert("The call to the server side failed. " + x.responseText);
            }

        });

Thanks,
SVK

2
Help for ParamQuery Pro / Re: Ajax Call not working
« on: June 22, 2015, 05:09:43 pm »
changing datatype=string is putting a "\" before each " in the returned string. PQGrid constructor call fails.

3
Help for ParamQuery Pro / Ajax Call not working
« on: June 20, 2015, 03:22:42 pm »
Hello,

I am trying to return the entire pqgrid model string including the data using an ajax call and populate the grid.
If i return the same string using sphageti code, it is showing the grid. With Ajax it is not showing.

Where could I have gone wrong?

Sphagetti code:
Code: [Select]
        var data = <%= bindgrid2() %>;
        //alert(data);
        var obj=eval('(' + data + ')');
        $grid1=$("#grid_json1").pqGrid(obj);

Ajax Call:
Code: [Select]
         $.ajax({
            type: "POST",
            url: "F1845.aspx/bindGrid2",
            data: "{}",
            processData: false,
            contentType: "application/json",
            dataType: "json",
            cache: false,
            async: true,
            success: function (msg) {
                var xyz = eval(msg.d);
                //$("#Text6").val(xyz);
                var obj = eval('(' + xyz + ')');

                //alert(obj);
                $grid1 = $("#grid_json").pqGrid(obj);


                alert("3");
                //$("#grid_json").pqGrid("refreshDataAndView");
                //alert("4");
            },
            error: function (x, e) {
                alert("The call to the server side failed. " + x.responseText);
            }
        });

alert("3") is not fired in ajax. All alerts before it get fired. I compared the two strings that are returned from the server and they are matching exactly.

Your help will be appreciated.
Thanks,
SVK

4
Help for ParamQuery Pro / Using "Remote" method with ASP.net Webforms
« on: June 15, 2015, 03:19:18 pm »
Hello,

I have been trying to get data into PQ grid from a asp.net web form with a webmethod using the "remote" option. However my call is never reaching the server webmethod bindGrid1. I would appreciate if you could tell me where I am going wrong. I am getting alert for "1a" but no alert for "1b" and the method is also not getting called on the server. Please see the code below

JavaScript:
Code: [Select]
obj.dataModel = {
            location: "remote",
            sorting: "local",
            paging: "local",
            dataType: "JSON",
            method: "GET",
            curPage: 1,
            rPP: 10,
            getUrl: function () {
                alert("1a");
                return { url: "F1845.aspx/bindGrid1"
               
                };
            },
            getData: function (dataJSON) {
                alert("1b");
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
                //return { data: data };
            }
        };


VB.net in ASP.net class F1845:
Code: [Select]
    <WebMethod()> Public Shared Function bindGrid1() As String
        Dim objquries As Quries
        Dim ds As New DataSet()

        Dim dt As New DataTable()
        Dim scriptString As String = ""
        objquries = HttpContext.Current.Session.Item("login")
        ds.Clear()
        svkstx$ = "QW24 '" & objquries.getId() & "'"
        ds = objquries.dsgrid(svkstx$)
        dt = ds.Tables(0)
        svkstx$ = Module1.GetJson(dt)
        sb$ = "{""totalRecords"":10, ""curPage"":1,""data"": " & svkstx$
        svkstx$ = svkstx$ + "}"


        Return svkstx$
    End Function

5
Help for ParamQuery Pro / Re: addrow calling editrow and update
« on: September 05, 2014, 02:57:59 pm »
I replaced paramquery 2.1.0 by 2.0.4 and the error went away. There was no change in my code. The call to update is going from the editrow automatically even after clicking just the add row button in 2.1.0.
Code: [Select]
$btn.button("option", { label: "Update", "icons": { primary: "ui-icon-check"} })
            .unbind("click")
            .click(function (evt) {
                evt.preventDefault();
               return update(rowIndx, $grid);
            });

6
Help for ParamQuery Pro / addrow calling editrow and update
« on: September 04, 2014, 01:56:20 pm »
Dear Sir,

Please find below code for addrow and editrow. Upon clicking the add row button, call is going to editrow as expected, but it is also going to update. This is adding a blank row in my paramgrid before I am able to enter any data. I would appreciate if you could help me in finding the error. This started happening after upgrading to paramquerypro 2.1.0.

Code: [Select]
       
function addRow($grid) {
            //alert("inadd");
            if (isEditing($grid)) {
                return false;
            }
            //append empty row in the first row.
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth() + 1; //January is 0!
            var yyyy = today.getFullYear();

            if (dd < 10) {
                dd = '0' + dd
            }

            if (mm < 10) {
                mm = '0' + mm
            }

            today = dd + '/' + mm + '/' + yyyy;                           
            var rowData = { scsno: "", ItemCd: "", Descript: "", Qty: 0.0,  Note: "",  FFRFlg: "", Rowid: "" }; //empty row template
            $grid.pqGrid("addRow", { rowIndxPage: 0, rowData: rowData });
           
            var $tr = $grid.pqGrid("getRow", { rowIndxPage: 0 });
           
            if ($tr) {
                //simulate click on edit button.
                $tr.find("button.edit_btn").click();
               
            }
           
        }

        //called by edit button.
        function editRow(rowIndx, $grid) {
            //alert("in edit");
            $grid.pqGrid("addClass", { rowIndx: rowIndx, cls: 'pq-row-edit' });
            $grid.pqGrid("editFirstCellInRow", { rowIndx: rowIndx });

            //change edit button to update button and delete to cancel.
            var $tr = $grid.pqGrid("getRow", { rowIndx: rowIndx }),
                $btn = $tr.find("button.edit_btn");
            $btn.button("option", { label: "Update", "icons": { primary: "ui-icon-check" } })
                .unbind("click")
                .click(function (evt) {
                    evt.preventDefault();
                    return update(rowIndx, $grid);
                });
            $btn.next().button("option", { label: "Cancel", "icons": { primary: "ui-icon-cancel" } })
                .unbind("click")
                .click(function (evt) {
                    $grid.pqGrid("quitEditMode");
                    $grid.pqGrid("removeClass", { rowIndx: rowIndx, cls: 'pq-row-edit' });
                    $grid.pqGrid("refreshRow", { rowIndx: rowIndx });
                    $grid.pqGrid("rollback");
                });
        }

Thanks,
SVK

7
Help for ParamQuery Pro / Filter not visible
« on: May 22, 2014, 02:17:33 pm »
Hi,

I am trying to show local header filter in my PQgrid which I am opening in a dialog box. Data model is local. AccData contains JSON data. Grid is visible. However, local header filters are not visible. I also did not understand the $.ajax call in your demo. If the data is available locally (in ACCdata), are you bringing the data again from the server with the filter applied or is it going to filter locally at the client side without a server trip?

    var gridDetailModel = {
        height: 300,
        width: 280,
        pageModel: { type: "local" }, //, rPP: 5, strRpp: "" },
        dataModel: {
            data: accData,
            location: "local",
            sorting: "local",
            dataType: "JSON",           
            sortIndx: "Accode",           
        },
        colModel: [
            { title: "Account Code", width: 80, dataIndx: "Accode",
                filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] } },           
            { title: "Description", width: 200, dataIndx: "AcName",
                filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] } }           
        ],
        editable: false,       
        freezeCols: 0,
        flexHeight: false,
        flexWidth: true,
        numberCell: { show: true },
        filterModel: { on: true, mode: "AND", header: true, type: "local" },
        title: "Account Details",
        showTop: true,
        showBottom: false,
        draggable: true,
        scrollModel: {horizontal: false }
    };
         
        var $gridMain1 = $("#grid_json1").pqGrid(gridDetailModel);
         $("#grid_json1").hide();
         $("#grid_json1").dialog({ autoOpen: false }); // Initialize dialog plugin
         $("#grid_json1").dialog( "option", "width", 400 );
        $("#grid_json1").dialog("Open");

Thanks,
SVK

8
Ok will do

9
Is it possible to use another paramgrid to select data instead of a drop down. The drop down shows only one column. I want to build multi field sorting and searching functionality in the drop down which would be possible if the drop down itself were a pqgrid. Is it possible to achieve this through nesting?

Can one PQgrid be placed on top of another through code. It is possible to drag it on top of another using the draggable: true property. can one set the left, top properties of a PQ grid.

Is it possible to hide a PQ grid in which data is populated using the location: local method and then show it ("popup") just below the cell of another PQ grid if user clicks that cell in "Edit" mode. the data shown in the "Popup" pqgrid has no relation with the selected cell. however if user clicks on a row in the "PopUp" pqgrid, the data from one of the cells should be copied to the selected cell.

I am currently running the evaluation version and plan to purchase the pro version if the above mentioned things can be achieved.

Thanks,
SVK

Pages: [1]