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

Pages: [1]
1
Help for ParamQuery Pro / Re: setSelection changes page
« on: September 20, 2018, 12:59:20 am »
Found it...

I changed rowIndx to rowIndxPage
Code: [Select]

        var isSelected = _self.SearchGrid.pqGrid("selection",   { type: 'row', method: 'isSelected', rowIndxPage: index }
        if (!isSelected) {
                    _self.SearchGrid.pqGrid("setSelection", { rowIndxPage: index });
                } 

also, bear in mind that index has to be a INT, otherwise "selection" with rowIndxPage will return undefined, at least in 3.3.2.


Code: [Select]
        var pqRowIndx = $(this).attr("pq-row-indx");
                var index = parseInt(pqRowIndx);


2
Help for ParamQuery Pro / setSelection changes page
« on: September 20, 2018, 12:25:22 am »

The setting:

ParamQuery Pro v3.3.2

Code: [Select]
        var obj = {
            scrollModel: { autoFit: true },
            datatype: "json",
            showTop: false,
            numberCell: { show: false },
            selectionModel: { type: 'row', fireSelectChange: true },
            dataModel: {
                data: []
            },
            pageModel: { type: "local", rPP: 20, strRpp: "{0}", strDisplay: "{0} to {1} of {2}" },
            refresh: _refreshSearchGrid,
            colModel: cols,
            hoverMode: 'row',
            selectChange: _searchGridSelectionChange
        };

        _self.SearchGridSelector = "[id='" + context + "'] div[controlname='" + grid.GridName + "']"
        _self.SearchGrid = $(_self.SearchGridSelector).pqGrid(obj);



    };

    function _refreshSearchGrid(refreshEvent, ui) {
        var trs = _self.SearchGrid.find("tr.pq-grid-row");
        trs.mousedown(function (mousedownEvent){
            if (mousedownEvent.which == 3)
        {
                var index = $(this).attr("pq-row-indx");
                var isSelected = _self.SearchGrid.pqGrid("selection",
                    { type: 'row', method: 'isSelected', rowIndx: index }
                );
                if (!isSelected) {
                    _self.SearchGrid.pqGrid("setSelection", { rowIndx: index });
                }                       
        }
        });       
    }

I also use JQuery's contextmenu on the grid container.

What happens is that when I right-click on row 2, it changes to page 2, row 3 page 3, row 4 etc...

The culprit seems to be the line

Code: [Select]
_self.SearchGrid.pqGrid("setSelection", { rowIndx: index });
For some reason, this selects the row as intended, but it also change the page to the row index.

Strange behaviour...

I'm still looking for an extra parameter, but if you have an answer, please do no hesitate to share it with me.




3
Help for ParamQuery Pro / ParamQuery Pro v3.3.2: Draggable
« on: September 19, 2018, 08:22:02 pm »
Hi,

Do you have a sample of the usage of the Draggable option?

What I'm trying to do is to enable dragging rows from one grid to another area, say a div, and perform some operations.

The user would select a few rows and start dragging them.

Right now the draggable option doesn't seem to do much.

If it's not supported, what can I do to enable this, thru custom code or prototype override?

Here is a sample of my grid initialization:

Code: [Select]
        var obj = {
            scrollModel: { autoFit: true },
            datatype: "json",
            showTop: false,
            numberCell: { show: false },
            selectionModel: { type: 'row', fireSelectChange: true },
            dataModel: {
                data: []
            },
            refresh: _refreshSearchGrid,
            colModel: cols,
            hoverMode: 'row',
            selectChange: _searchGridSelectionChange,
            draggable: true
        };

        _self.SearchGridSelector = "[id='" + context + "'] div[controlname='" + grid.GridName + "']"
        _self.SearchGrid = $(_self.SearchGridSelector).pqGrid(obj);



Thanks for your help.

Pages: [1]