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

Pages: [1] 2 3
1
Help for ParamQuery Pro / Re: setSelection
« on: February 18, 2016, 04:23:29 pm »
FYI

Code that worked fine with v2.4, jquery v2 now needs delay using v3.2, jquery v2

just adding setTimeout - solved the issue I was seeing

2
Help for ParamQuery Pro / setSelection
« on: February 17, 2016, 08:05:19 pm »
Hi I'm using v3.2.0 and jquery v2

If row is selected using mouse then I get fully populated address

setting selection using
$("#HotelGrid").pqGrid("setSelection", { rowIndxPage: rowi });
address is not populated I get empty array

address is obtain using
 var address = this.selection().address();

any ideas

3
Help for ParamQuery Pro / Re: Upgrading v2.4 to v3.2
« on: February 16, 2016, 01:57:33 pm »
Thanks all sorted - I was sure that dataIndx - numeric and name were interchangeable

4
Help for ParamQuery Pro / Re: Upgrading v2.4 to v3.2
« on: February 15, 2016, 09:49:27 pm »
Hi Thanks that fixed the display issue - now getting completed grid but once I add in new sortModel

var sortModelhl = {
                    cancel: false,
                    single: true,
                    type: "local",
                    sorter: [{ dataIndx: "name", dir: "up" }]
                };

i get a new error

pqgrid.min.js:416 Uncaught TypeError: Cannot read property 'sortType' of undefined

5
Help for ParamQuery Pro / Re: Upgrading v2.4 to v3.2
« on: February 15, 2016, 08:12:14 pm »
Some further info this is the pqgrid.min.js error that is showing in Chrome console

pqgrid.min.js:140 Uncaught TypeError: Cannot read property 'option' of undefined

6
Help for ParamQuery Pro / Re: Upgrading v2.4 to v3.2
« on: February 15, 2016, 07:54:43 pm »
Hi Thanks for the suggestion but thats not the issue stopping data records displaying. I have stripped out the sort conditions and other rendering and filtering - but still not data records are display. I can see then in the getData section by tracking dataDoc results - adjusted code below

                var colModelhl = [
                { title: "Code", dataType: "string", width: "50", dataIndx: 0},
                { title: "Name", dataType: "string", width: "250", dataIndx: 1 },
                { title: "Resort Name", dataType: "string", width: "250", dataIndx: 4},
                { title: "Country", dataType: "string", width: "100", dataIndx: 6 },
                { title: "InActive", dataType: "string", width: "100", dataIndx: 2 }
                ];

                var dataModelhl = {
                    //cache: true,
                    location: "remote",
                    dataType: "xml",
                    method: "POST",
                    getUrl: function () {
                        return {
                            url: "@Url.ModuleUrl().Action("AccessHotelList")",
                            data: { 'id': ctr }
                        };
                    },
                    getData: function (dataDoc) {
                        //debugger;

                         var obj = { itemParent: "BriefAccommodationInfo", itemNames: ["code", "name", "inactive", "resortCode", "resortName", "countryCode", "countryName"] };
                        return { data: $.paramquery.xmlToArray(dataDoc, obj) };
                    }
                };


                var obj = {
                    width: 750, height: 0,
                    dataModel: dataModelhl,
                    colModel: colModelhl,
                   
                    pageModel: { rPP: 10, type: "local", rPPOptions: [1, 2, 5, 10, 20, 100] },
                    title: "<b>Hotel List</b>",
                    flexHeight: true,
                    paging: true,
                    draggable: false,
                    editable: false,
                    //resizable:true,           
                    scrollModel: { horizontal: false },
                    numberCell: false,
                    selectionModel: {
                        type: 'row', mode: 'single'
                    },
                   

                    collapsible: { on: true, collapsed: false },
                    freezeCols: 0,
                    rowSelect: loadHotel
                };

                $gridhl = $("#HotelGrid").pqGrid(obj);

               $gridhl = $("#HotelGrid").pqGrid("refresh");

7
Help for ParamQuery Pro / Re: Upgrading v2.4 to v3.2
« on: February 15, 2016, 06:36:25 pm »
Hi I Have made the change you suggest but this doesn't help - still empty grid

                    load: function(evt, ui){
                        var $grid = this.widget(),
                            data = $grid.pqGrid('option','dataModel.data');

                        $.each(data, function (i, rowData) {
                            if (rowData[2] == "true") {
                                //alert("r" + i.toString());
                                $grid.pqGrid("addClass", { rowIndx: i, cls: "pq-red" });
                               
                            }
                        });
                       
                    },

8
Help for ParamQuery Pro / Upgrading v2.4 to v3.2
« on: February 12, 2016, 09:18:23 pm »
Hi Having a problem moving from v2.4 to v3.2 - all code works correctly using v2.4 but after moving to v3.2 my grids are empty of data. I've checked the requirements and all js and css I think are need are loaded on the page. From chnagelog all I needed to do was change to sortModel, here's example code if any can spot where it's wrong please respond

                var colModelhl = [
                { title: "Code", dataType: "string", width: "50", dataIndx: 0, render: filterRender },
                { title: "Name", dataType: "string", width: "250", dataIndx: 1, render: filterRender },
                { title: "Resort Name", dataType: "string", width: "250", dataIndx: 4, render: filterRender },
                { title: "Country", dataType: "string", width: "100", dataIndx: 6, render: filterRender },
                { title: "InActive", dataType: "string", width: "100", dataIndx: 2 }
                ];

                var dataModelhl = {
                    //cache: true,
                    location: "remote",
                    dataType: "xml",
                    method: "POST",
                    getUrl: function () {
                        return {
                            url: "@Url.ModuleUrl().Action("AccessHotelList")",
                            data: { 'id': ctr }
                        };
                    },
                    getData: function (dataDoc) {
                        //debugger;
                        var obj = { itemParent: "BriefAccommodationInfo", itemNames: ["code", "name", "inactive", "resortCode", "resortName", "countryCode", "countryName"] };
                        return { data: $.paramquery.xmlToArray(dataDoc, obj) };
                    }
                };

                var sortModelhl = {
                    cancel: false,
                    single: true,
                    type: "local",
                    sorter: [{ dataIndx: "name", dir: "up" }]
                };

                var obj = {
                    width: 750, height: 0,
                    dataModel: dataModelhl,
                    colModel: colModelhl,
                    sortModel: sortModelhl,
                    pageModel: { rPP: 10, type: "local", rPPOptions: [1, 2, 5, 10, 20, 100] },
                    title: "<b>Hotel List</b>",
                    flexHeight: true,
                    paging: true,
                    draggable: false,
                    editable: false,
                    //resizable:true,           
                    scrollModel: { horizontal: false },
                    numberCell: false,
                    selectionModel: {
                        type: 'row', mode: 'single'
                    },
                    filterModel: { mode: 'OR', type: 'local' },
                    toolbar: {
                        cls: "pq-toolbar-search",
                        items: [
                            { type: "<span style='margin:5px;'>Filter</span>" },
                            { type: 'textbox', attr: 'placeholder="Enter your keyword"', cls: "filterValue", listeners: [{ 'keyup': filterhandler }] },
                            {
                                type: 'select', cls: "filterColumn",
                                listeners: [{ 'change': filterhandler }],
                                options: function (ui) {
                                    var CM = ui.colModel;
                                    var opts = [{ '': '[ All Fields ]' }];
                                    for (var i = 0; i < CM.length; i++) {
                                        var column = CM;
                                        var obj = {};
                                        obj[column.dataIndx] = column.title;
                                        opts.push(obj);
                                    }
                                    return opts;
                                }
                            },
                            {
                               type: 'select', style: "margin:0px 5px;", cls: "filterCondition",
                               listeners: [{ 'change': filterhandler }],
                               options: [
                               { "contain": "Contains" },
                               { "begin": "Begins With" },
                               { "end": "Ends With" },
                               { "notcontain": "Does not contain" },
                               { "equal": "Equal To" },
                               { "notequal": "Not Equal To" },
                               { "empty": "Empty" },
                               { "notempty": "Not Empty" },
                               { "less": "Less Than" },
                               { "great": "Great Than" },
                               { "regexp": "Regex" }
                               ]
                            },
                            {
                                type: 'button', icon: 'ui-icon-plus', label: 'Duplicate Property', listeners: [
                                  {
                                      "click": function (evt, ui) {

                                          //add empty item
                                          duplicateProperty(evt, ui);

                                      }
                                  }
                                ]
                            },
                            {
                                type: 'button', icon: 'ui-icon-plus', label: 'Refresh list', listeners: [
                                  {
                                      "click": function (evt, ui) {

                                          //add empty item
                                          refreshHotellist("1");

                                      }
                                  }
                                ]
                            }
                        ]
                    },
                    load: function(evt, ui){
                        var $grid = $(this),
                            data = $grid.pqGrid('option','dataModel.data');

                        $.each(data, function (i, rowData) {
                            if (rowData[2] == "true") {
                                //alert("r" + i.toString());
                                $grid.pqGrid("addClass", { rowIndx: i, cls: "pq-red" });
                               
                            }
                        });
                       
                    },
                    collapsible: { on: true, collapsed: false },
                    freezeCols: 0,
                    rowSelect: loadHotel
                };

                $gridhl = $("#HotelGrid").pqGrid(obj);

                $gridhl = $("#HotelGrid").pqGrid("refresh");

9
Hi Thanks for the guide - I can see that the rows are now traversed but class is not added to row, my code is

                    load: function(evt, ui){
                        var $grid = $(this),
                            data = $grid.pqGrid('option','dataModel.data');

                        $.each(data, function (i, rowData) {
                            if (rowData[2] == "true") {
                               
                                $grid.pqGrid("addClass", { rowIndx: i, cls: "pq-red" });
                               
                            }
                        });
                       
                    },

10
Hi I'm using v2.3.0, and want to dynamically set the row background colour based on a column value, with remote data I thought it would be possible to do something like

                    load: function (evt, ui) {
                        var $grid = $(this).closest('.pq-grid');

                        $.each(ui.data, function (i, d) {
                            if (d[2] == 'true') {
                                $grid.pqGrid("addClass", { rowIndx: i, cls: 'pq-red' });
                            }
                        });

                    },

But this doesn't work

Can you give some pointers please

Also I see v2.4.0 requires renewal - do you have a renewal price or is it a new purchase that's required

11
Help for ParamQuery Pro / Re: Inline Editing
« on: March 06, 2015, 09:15:33 pm »
Hi Thanks - I did notice that which helped - but finally resolved by adding this statement after commit, in update function
$grid.pqGrid("quitEditMode")
                        .pqGrid("removeClass", { rowIndx: rowIndx, cls: 'pq-row-edit' })
                        .pqGrid("rollback");
now works as previously under 2.0.4

12
Help for ParamQuery Pro / Re: Inline Editing
« on: March 06, 2015, 07:50:05 pm »
Hi I have set $grid.on('pqgridrefresh pqgridrefreshrow', function () {

But still get same problem

13
Help for ParamQuery Pro / Re: Inline Editing
« on: March 06, 2015, 02:01:07 pm »
Hi Thanks that fixed the validation issue, but I still have a problem with the Edit, Delete -> Update, Cancel buttons
going to edit mode is Ok, but clicking on Update button does not fully complete and re-display the Edit, Delete buttons - I'm left with Update, Cancel

Any ideas on that

14
Help for ParamQuery Pro / Re: Inline Editing
« on: March 05, 2015, 06:52:04 pm »
In above I mean't to say is 'This statement always returns 'false'

15
Help for ParamQuery Pro / Inline Editing
« on: March 05, 2015, 06:44:44 pm »
Hi I have a grid with inline editing and noticed that what was working correctly under 2.0.4 now doesn't under 2.3.0. - my update function is

        function update(rowIndx, $grid) {
            if (!$grid.pqGrid("saveEditCell")) {
                return false;
            }
            var rowData = $grid.pqGrid("getRowData", { rowIndx: rowIndx }),
                recIndx = $grid.pqGrid("option", "dataModel.recIndx"),
                type;

            var isValid = $grid.pqGrid("isValid", { rowData: rowData }).valid;
            if (!isValid) {
                return false;
            }

            var isDirty = $grid.pqGrid("isDirty");
            if (isDirty) {

                if (rowData[recIndx] == null) {
                    //add record.
                    type = 'add';

                }
                else {
                    //update record.
                    type = 'update';

                }
               
                $grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-edit' });

                $grid.commit({ type: type, rows: [rowData] });
                $grid.refreshRow({ rowIndx: rowIndx });


            }
            else {
                $grid.quitEditMode();
                $grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-edit' });
                $grid.refreshRow({ rowIndx: rowIndx });
            }
        }

This statement always fails

 if (!$grid.pqGrid("saveEditCell")) {
                return false;
            }

and if I bypass all appears to work but get left with display of Update, Cancel buttons rather than Edit, Delete

Any ideas?

Pages: [1] 2 3