ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: mikep on March 05, 2020, 09:34:12 pm
-
I'm creating a new grid row in my dropModel:
dropModel: { drop: function (evt, uiDrop)
{
$gridMain.pqGrid('addRow', {newRow: {…}}
});
1. The new row is added to the bottom of the grid. How can I add the row directly beneath the row where it was dropped?
2. How can I shade the BGColor of the new row?
-
1. uiDrop.rowIndx provides information about rowIndx of drop location. Pass that to addRow() method.
https://paramquery.com/pro/api#option-dropModel
2. Add pq_rowstyle: { background: "#ff0000" } property to new row.
grid.addRow({
newRow: {
key1: val1,
key2: val2,
.....
pq_rowstyle: { background: "#ff0000" }
},
rowIndx: uiDrop.rowIndx
})
-
Thank you, the drop location now works. My syntax isn't coloring though. Any ideas?
$gridMain.pqGrid('addRow',
{
newRow: {
pq_rowstyle: { background: ""#ff0000" },
projectuid: uiDrag.rowData.projectuid, res: dropRowData.res, resourceuid: dropRowData.resourceuid
},
rowIndx: uiDrop.rowIndx
});
-
Please share a jsfiddle.
-
https://jsfiddle.net/942v085w/1/
I'm trying to change the row color in the Drop Grid. The fiddle example has an error on drop, which my actual project does not. My main concern is the coloring syntax.
-
There is no addRow method in your jsfiddle.
Please note that pq_rowstyle: { background: ""#ff0000" } is a property of newRow.
-
I need to set background for addRow and updateRow. I've updated the example to use addRow, but need syntax for both.
https://jsfiddle.net/942v085w/4/
Here's what I tried in my project, which doesnt work:
$gridMain.pqGrid('addRow',
{
newRow: {
id: "testing color",
pq_rowstyle: { background: "#ffffff" }
}, rowIndx: uiDrop.rowIndx,
});
-
Please check this: https://jsfiddle.net/u9xa0Lrb/1/
and use the latest version 7.1.0 of pqgrid.
-
That worked. Thank you. I am trying the same syntax with updaterow now and it's not coloring:
https://jsfiddle.net/942v085w/7/
-
Please check this: https://jsfiddle.net/ydft4rLu/
this.getRowData({rowIndx:uiDrop.rowIndx}).pq_rowstyle = { background: 'blue' }
-
Thank you. I updated this to do actions on add/update and it works here: https://jsfiddle.net/jb8ke9q7/1/
When I do the same thing here: https://rpm1.azurewebsites.net/rpm.aspx, The blue coloring and the text changing (updateRow) does not happen until I call the addRow. It's like it's a step behind. Any suggestions? To recreate:
1. Drag xxxx ADMD (on left grid) onto xxxCRAL
2. Drag xxx CRAL (on left) onto Mike Peterson
-
I got it working now. Thank you.
-
For this example: https://jsfiddle.net/4s6akemd/2/
1. when I drag/drop on groupings, the drag item get dropped in a new group at the bottom of the grid. This is fine/expected, but how can I give focus to the new row, so the user can see the new item, particularly if it scrolls off the viewable area of grid.
2. Can I drag items by grabbing the items text, in addition to the "||" on the far left of the item. That way it's quicker for users to grab the row they want to drag.
-
1. Please use scrollRow and focus methods.
https://paramquery.com/pro/api#method-scrollRow
https://paramquery.com/pro/api#method-focus
2. Please use combination of dragModel.clsHandle and dragModel.diDrag options.
-
Thank you. I have attempted to do these in the link below. Any advice on what I need to change?
1. How do I specify the rowIndxPage? Dont I just need to set the focus on the last row in the grid, if that's where it is dropped? Also, if grouping is removed I'd like the row dropped where it is dragged. I was using "rowIndx: uiDrop.rowIndx" which works, but I'm guessing I need to check if grouping is applied, since this doesn't work with grouped rows
2. I changed colIndexes, but don't know how to allow drag if they select anywhere in the row, rather than just the "||" area to the left.
https://jsfiddle.net/cu16n4wx/1/
-
1. This doesn't work with grouped rows.
var ri = $gridRes.pqGrid('addRow', {
newRow: {
proj: uiDrag.rowData.proj,
grp: uiDrag.rowData.grp,
pq_rowstyle: {
background: "#ff0000"
}
},
//rowIndx: uiDrop.rowIndx,
});
$gridRes.pqGrid('scrollRow', {
rowIndxPage: ri
}, function(){
//debugger;
$gridRes.pqGrid('focus', {
rowIndxPage: ri,
colIndx: 1
});
});
2. This makes the whole row draggable.
clsHandle: 'pq-grid-row',
https://jsfiddle.net/rt8gn1f9/