ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: lsl on January 02, 2015, 02:43:38 pm
-
I want to have a grid with single group field but
1) Display multiple fields.
I want a grid with an invoice list sorted by customer code. But it was broken by customer code and showed customer code, customer name, telephone and fax in the header line (Just one single line)
2) Showing the sub-total for each break
Code,Name,Telephone,Fax
Invoice 1, Date1, Cur1 , Amount1,ExRate1, Balance1
Invoice 2, Date2, Cur2 , Amount2,ExRate2, Balance2
Sub-total
Code2,Name2,Telephone2,Fax2
Invoice 3, Date3, Cur3 , Amount3,ExRate3, Balance3
Invoice 4, Date4, Cur4 , Amount4,ExRate4, Balance4
Sub-total
Total
Thanks
-
Subtotal can be displayed for every change in group field with help of column.summary option.
http://paramquery.com/pro/api#option-column-summary
Example: There is sub total and total displayed for freight field in this demo:
http://paramquery.com/pro/demos/group_rows
Title of the group can display only the field value which caused the grouping and number of items/sub-items.
-
Thanks.
I want to change the color of the sub-total row.
Can I change the class of sub-total row ? or able to define pq_rowcls on the sub-total row.
-
In the example, there are two levels of sub-total. It is better to show the group caption beside the sub-total. For example, showing "Yvonne Moncada" in the "Order Date" column at the "sub Total:306.64" row and showing "Argentina" in the "Order Date" column at the Total:598.58" row.
Can I do that?
-
It's not supported currently. We would check its viability for the next version thanks for your feedback.
-
It works fine for showing grouping head and sub-total.
However , I want to do further enhancement so that the grid able to add and edit the records.
It will be error when I want to add the records. it shows "Uncaught TypeError: Cannot read property 'push' of undefined"
in field pqgrid.dev.js in line 9595
cols[dataIndx].push(rowData[dataIndx]).
But there is no error for editing the grid.
-
Please check and assign dataIndx correctly.
-
The error occurred when it was set as
var rowIndx = $grid.pqGrid( "addRow", { rowData: obj, rowIndx:0 }) ;
That is, it will be at the first line to input the record when it has the grouping after I pressed the add record button.
When there has data in the grid, the first line supposed to be the grouping and pqgrid will try to use such structure to build up the first line, I think.
If I change the coding as follows,
var rowIndx = $grid.pqGrid( "addRow", { rowData: obj}) ;
That is,it will be at the last line to input the record. If there has data in the grid, it works fine.
But, if there is no data in the grid, the error still occurs.
Can it be solved if I want to use the first line to edit the adding record and the case of no data?
-
I couldn't find any issue. Please see this example when there is no data in the grid.
http://jsfiddle.net/uatce4at/
-
I made a modification to your jsfiddle, actually we are adding a new row with no initial data inside. (screen attached)
and when i push the "+" button, the error pops up.
-
Grouping can't take place when group by fields are missing and hence the error.
You could toggle the grouping for the grid. When user adds a new row with missing group by fields missing, remove the grouping and when the user is done entering the data for that row, re-enable the grouping.
-
I have solved the problem by putting a '*' in the grouping field
Thanks
-
Thanks.
I want to change the color of the sub-total row.
Can I change the class of sub-total row ? or able to define pq_rowcls on the sub-total row.
You can add classes to the grouping title and summary rows in v2.4.0
http://paramquery.com/pro/demos/group_rows
-
In the example, there are two levels of sub-total. It is better to show the group caption beside the sub-total. For example, showing "Yvonne Moncada" in the "Order Date" column at the "sub Total:306.64" row and showing "Argentina" in the "Order Date" column at the Total:598.58" row.
Can I do that?
You can do it in v2.4.0
http://paramquery.com/pro/demos/group_rows