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

Pages: [1] 2 3
1
To be clear, the expected behavior is that if the select condition is 'equal' and one of the column values is "This has 3   spaces"  then an entry of

"This has 3   spaces"

in the filter options will not result in a match when it is selected, but an entry of

"This has 3   spaces" 

will result in a match?  Thanks.

2
I have string columns in some grids where select filters are populated from the column values.  As in:
{
    title: "Gr Name", dataType: "string", dataIndx: "GrName", width: 200,
    filter: {
   type: 'select', condition: 'equal', valueIndx: "GrName", labelIndx: "GrName",
   prepend: { '': '--Select--' }, listeners: ['change']
    }
}

then after json load:

var column = $gridPeerGroups.pqGrid("getColumn", { dataIndx: "GrName" });
var filter = column.filter; filter.cache = null;
filter.options = $gridPeerGroups.pqGrid("getData", { dataIndx: ["GrName"] });

This works fine unless a column value has sequences of 2 or more spaces.  When that happens, then selecting that entry in the filter drop down will not result in a match.  My workaround is to replace multiple spaces in the filter options with hard spaces as in

for (var i = 0; i < filter.options.length; i++) {
   filter.options.GrName = replaceAll('  ', '&nbsp;&nbsp;', filter.options.GrName);
}

function replaceAll(find, replace, str) {
   return str.replace(new RegExp(find, 'g'), replace);
}
 
Then there is a match when that option is selected in the filter and the correct row(s) are displayed.  Is this the expected behavior?  Is there a better way to do this?  Thanks

3
I have a grid of string columns, it gets populated with one empty row.  I then use addclass to turn this row into input cells using

$gridAnalysis.pqGrid("addClass", { rowIndx: 1, cls: 'pq-delete pq-edit' });

I would like to restrict the input to numeric values.  Is there another class that can be added or another way to turn just these cells into integer type?  I would also like to know what classes other than pq-delete and pq-edit are available.

On a similar note, I recently got a response to an issue I posted where the answer was to use refresh: false as an argument to updateRow().  That solved my issue, but I don't see this argument in the documentation for updateRow().  I suspect there are other arguments to other methods that I don't know about that could be very useful.  Where can find all of this?  Thanks.

4
Help for ParamQuery Pro / Re: Progress Bar during updateRow Loop
« on: July 02, 2015, 05:22:41 am »
"refresh: false" as an argument to updateRow() solves the issue.  The process is now fast enough that a progress bar is not needed. 

I don't see "refresh: false" on the API page as a documented argument to updateRow().  Is this implied?  How can I find other arguments that are available to the various methods that are not specifically listed on the API page?  Thanks.

5
This should have been posted in the Pro forum.

6
Help for ParamQuery Pro / Progress Bar during updateRow Loop
« on: July 01, 2015, 04:53:06 am »
I have a grid that gets updated after the user initiates a calculation function.  This currently takes 30 seconds or more if there are 150+ rows.  trackModel is on.

The slow part of the update is after the calculations when the updated column values are displayed. This is done with a loop over all the rows using updateRow to update those rows with changed values in 2 columns:

                $gridEmployees.pqGrid("updateRow", {
                      rowIndx: ratingCalculations.rownum, row: {
                      'PeerGroupRank': ratingCalculations.Rank,
                      'PeerGroupQuartile': ratingCalculations.Quartile
                      }, checkEditable: false
                  });

I have a progress bar to display during  the whole process

    <div id="calcprogress" class="progress progress-striped active" style="display: none;">
        <div class=" progress-bar" role="progressbar" style="width:100%;">Calculating...</div>
    </div>

I can't get $("#calcprogress").show(); to work while the grid is being updated with updateRow.  Nothing is displayed.  Is there a way around this? 

Would refreshing dataModel.data work with trackModel on?.  There are 20 columns in the grid, only 2 are being updated and other columns might have changes that haven't been committed?  If I could do that then there is no need for a progress bar.  Thanks.

7
I have a grid that gets updated after the user initiates a calculation function.  This might take 30 seconds or more if there are 150+ rows.  trackModel is on.

The slow part of the update is after the calculations when the updated column values are displayed using updateRow :

                $gridEmployees.pqGrid("updateRow", {
                      rowIndx: ratingCalculations.rownum, row: {
                      'PeerGroupRank': ratingCalculations.Rank,
                      'PeerGroupQuartile': ratingCalculations.Quartile
                      }, checkEditable: false
                  });

I have a progress bar to display during  the whole process

    <div id="calcprogress" class="progress progress-striped active" style="display: none;">
        <div class=" progress-bar" role="progressbar" style="width:100%;">Calculating...</div>
    </div>

I can't get $("#calcprogress").show(); to work while the grid is being updated with updateRow.  Is there a way around this?  Thanks.

8
Help for ParamQuery Pro / Re: isDirty on Column Values?
« on: June 15, 2015, 10:08:11 pm »
Thank you, this is what I was looking for.

9
Help for ParamQuery Pro / Using groupModel with pageModel
« on: June 12, 2015, 05:25:08 am »
I have a grid with pageModel turned on and groupModel on the column "PeerGroupName".  The groups are collapsed.  When the grid is displayed, on each page I get the grouping of 50 rows, not a list of 50 groups which is what I would like to see.  If there are 3 groups with 40, 30 and 50 rows , then page 1 has 2 rows "Group 1 (40 Employees)" and "Group 2 (10 Employees)".  Page 2 has 2 rows  "Group 2 (20 Employees)","Group 3 (30 Employees)".  Page 3 has 1 row "Group 3 (20 Employees)".  In this example I would like to get 1 page with "Group 1 (40 Employees)", "Group 2 (30 Employees)", "Group 3 (50 Employees)".  Is this possible?  Thanks.

pageModel: { type: 'local', rPP: 50 },

groupModel: groupModel = {
dataIndx: ["PeerGroupName"],
collapsed: [true],
title: ["({1} Employees)"],
dir: ["up"],
icon: [["ui-icon-triangle-1-se", "ui-icon-triangle-1-e"], ] }

10
Help for ParamQuery Pro / isDirty on Column Values?
« on: June 12, 2015, 04:49:21 am »
When using trackModel is it possible to check which column values on a "dirty" row have caused the row to become dirty?  I have a grid with editable and non-editable columns.  If a row is dirty only because a value in a non-editable column has changed then I want to ignore that row and not include it in what I am sending back to the server.  Can this be done with IsDirty or some other method?  Thanks.

11
I created a jsfiddle (https://jsfiddle.net/mshapiro/n6ts0op8/) but I don't have this issue in the jsfiddle environment.  I don't think the references in jsfiddle are pointing to v. 2.4.1.   I am using http://paramquery.com/Content/js/pqgrid.min.js as the pggrid reference in jsfiddle, I don't know how to include v. 2.4.1 in jsfiddle (same for the .css files). 


The cshtml page in  my .NET application looks like this:

@section Styles {
    <link href="@Url.Content("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("gridPro/pqgrid.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("gridPro/themes/office/pqgrid.css")" rel="stylesheet" type="text/css" />
}

@section FooterScripts
{
    <script src="@Url.Content("http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js")" type="text/javascript"></script>

    <script src="@Url.Content("gridPro/pqgrid.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("MyApplication.js")" type="text/javascript"></script>
}

When I switch the pgrid files to version 2.3.0 then the problem goes away.  Am I missing something?  Thanks.


12
hoverMode: 'row' is what is causing the problem in my grids.  When I remove that setting then the problem goes away and I can specify an absolute width with no issues (that I know of).  When I remove it don't get hoverMode: 'row' behavior even though that is supposed to be the default.
hoverMode: 'cell' is okay. 

I would like to use hoverMode: 'row' in most grids.  What would cause a conflict with that setting?

13
I have found what appears to be a conflict between using a width setting other than "flex" and local sorting by header click.  With width set as a number or a percent, the following is happening: The column header is clicked, the grid data is sorted internally but the view does not refresh and the column header that was clicked does not highlight with the sort up/down indicator. 

When this happens and a row or cell is selected after sorting (depending upon the selectionModel setting), the rowClick/rowSelect or cellClick/cellSelect events return the correct row for the new sort order even though that may not be the row on the screen that was selected.  Sometimes this occurs when the grid is initially displayed and other times after a row or cell is selected, and then refreshView will correct it.  The headerCellClick, beforeSort and sort events are firing with the correct column value.  I had not seen this before switching to version 2.4.1. 

These are the settings on one of the grids where it happens:

        width: '1000',
        height: '400',
   editable: false,
   wrap: false,
   resizable: true,
   columnBorders: true,
        sortable: true,
        collapsible: { collapsed: false, toggle: false },
        scrollModel: { horizontal: true, lastColumn: 'none' },
        selectionModel: { type: 'row', mode: 'single' },
        hoverMode: 'row',
        draggable: true, 
        dataModel: { location: "local", recIndx: "PeerGroupId", sortIndx: "PeerGroupCode" },

This is happening on all grids where an absolute width is specified.  I need to use absolute widths in some grids because they have many columns and I need to use a horizontal scrollbar.  Thanks.

14
Help for ParamQuery Pro / Re: Preserve track changes when sorting
« on: May 01, 2015, 05:51:31 am »
This works fine unless the current sortIndx and sortDir are already what I want.  In that case using this method results in a toggle in the sort direction regardless of what is specified as "dir (unless I'm missing something).  I use this method to sort by another column and then by the column I want, that works.  Any other way to resort the grid using the active sortIndx and sortDir (and preserve track changes)?  I need to do this because the values in the sortIndx column may have changed.  Thanks.

15
Help for ParamQuery Pro / Preserve track changes when sorting
« on: April 29, 2015, 05:48:19 am »
I have a grid using trackModel: { on: true }.  The sortIndx is "Name" and the grid can be sorted by any column. The User can make edits in several columns and then use a toolbar button to initiate a ranking function that, if successful, will populate the "Rank" column in all rows with an integer 1-n where n is the number of rows in the grid.  An Undo button is available to use "rollback" to rollback the current edits.  When ranking is successful, I would like to then sort the grid by the Rank column but not lose the ability to rollback the current edits.  Sorting by clicking the Rank column header will do this, but changing sortIndx to "Rank" and using refreshDataAndView (apparently) resets tracking.  Is there a way to refresh the grid with a different sort order and preserve tracking?  Thanks.

Pages: [1] 2 3