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

Pages: [1]
1
Help for ParamQuery Grid (free version) / Totals row with local filtering
« on: February 25, 2016, 12:48:27 am »
Hello.  We are looking to add a row would display the totals for whatever data is currently on display in the grid.  Ex


Data :
{ company:  'company A',  cost: '100' },
{ company:   'abc corp',  cost: '200' }

if the user can filter (its local filtering) the company to just abc corp the cost total would be $200.   With no filter, the total should be 300.

Current fiddle is at : http://jsfiddle.net/bvo4s5vr/   forked from the forum guide. But this is not showing any summary data at all.

I have seen the demo for the Summary row but can not seem to get it functional.

Still working on it http://jsfiddle.net/c3mr0mby/   this has the filter for the company and the total works correctly however the total is not changed when filtered. Is there an on filer that I am missing?

2
I have a requirement where a grid will 10 columns with only column 1 and 5 required.   We are looking for a way to make it clear that the columns are required.  I have added stars to the title but I am not sure I like the appearance of that.  Is there a way to color the title font / add a class to JUST the header.  (I tried the cls tag in column model but it appears that only gets applied to the rows).

Basically: Is it possible to mark only required headers in a certain manner?

3
add  the value
Code: [Select]
   stripeRows: true
  into the object you pass into create the object.  (Should be the same place you set the title, etc)

alternatively with jQuery after the object has been created
Code: [Select]
   $( "#grid_div_id" ).pqGrid( "option", "stripeRows", false );


I believe its only support for custom themes such as office (based on the note ' Currently this option is supported only for custom themes e.g. 'Office' theme.' on http://paramquery.com/pro/api24)


Disclaimer: I am not affiliated with paramquery just bored and wanting to help.

4
Just wondering: Any update on a fix or suggestions on a work around?

5
I am using the provided editor a cell  checkbox.  The question is that once we leave the cell, it becomes true or false instead of leaving the check box.

Is there a way to disable this and keep the checkbox always displayed?

I have tried the following:
Code: [Select]
render: function (ui) {
   var checked = (ui.rowData['AODBIndex'])
      if (checked)
          return ("<input type='checkbox' name='AO' checked='checked'>");
      else
          return ("<input type='checkbox' name='AO' >");
}

I have to set the checkbox to editable: false in order to keep the checkbox from becoming edit box so,

I combined this render function with a cellClick event for the checkbox cell that would toggle the value in a different cell based upon its current value.

ISSUE --> The issue with this method, the cells are never marked as dirty and therefore not sent to the database when the user clicks AcceptChanges.

Is there an easier way of doing this?
OR is there a way to manually tell paramgrid that a cell has in fact changed? (I don't mind if its a not cleared once I change the value back)

6
Yikes!   

Any idea on time frame / suggestions on work around?


My initial thought would be to catch the click and disregard it somehow but this is my first web project so not exactly sure.


7
I tried looking at the demo from my second laptop (has never run this code)

went to paramquery.com/demos -> filter -> local header filtering

* I noticed all your text filters stretch across the entire column *

opened console and clicked the gray space under paid (not the check box the area next to the check box)
same error is logged into console. 
This is with IE 9 on that machine  IE 11 on my development machine


The same issue occurs in the remote filtering as well.

8
Code: [Select]
<script>
        $(function () {
            var data = [[1, 'Exxon Mobil', '339,938.0', '36,130.0'],
            [2, 'Wal-Mart Stores', '315,654.0', '11,231.0']];

            var dataModel = {
                location: "local",
                sorting: "local",
                sortIndx: 'Company',
                sortDir: "up"
            }

            var obj = {
                width: 840, height: 460,
                dataModel: dataModel,
                wrap: false,
                hwrap: false,
                showBottom: false,
                editable: false,
                selectionModel: { type: 'cell' },
                filterModel: { on: true, mode: "AND", header: true },
                title: "Shipping Orders",
                resizable: true,
                columnBorders: true,
                freezeCols: 2
            };

            obj.colModel = [
                { title: "Rank", width: 100, dataType: "integer" },
                { title: "Company", width: 200, dataType: "string",
                filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'], dataIndx: 'Company' }
                },
                { title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
                { title: "Profits ($ millions)", width: 150, dataType: "float", align: "right" }
            ];
            obj.dataModel = { data: data };

            var $grid = $("#paged_grid").pqGrid(obj);

            $grid.pqGrid("filter", { oper: 'add', data: [] })
            .pqGrid("refresh");
        });
    </script>


I changed the sortIndx to match the dataIndx but am still getting the error (that was caused by the switch from all my live data to dummy data)

I should mention that the filter DOES work correct for the company name but I get the crash when I click any where red.  (From original post)

Looks like the crash is in fn.getColIndx 

Call Stack    (all pqgrid.dev.js file)
 fn.getColIndx     (line 3109)
 fc.scrollColumn   (line 3562)
 handlFocus   (line 7399)


Is there a cdm for paramquery I can use for a jfiddle?


9
Hello,

I currently have a problem throughout my grid where if the user clicks in certain spots (marked in red in image) in the filtering row we are receiving a crash:

Unhandled exception at line 3109, column 4 in pqgrid.dev.js     --- "JavaScript runtime error: dataIndx NA"



It is basically any where the filter is not occupying in the row with the filters.   Some columns may not need a filter and clicking these areas causes the issues.

Note: This is a simplified version of the code from the demo. 



Code: [Select]
<script>
        $(function () {
            var data = [[1, 'Exxon Mobil', '339,938.0', '36,130.0'],
            [2, 'Wal-Mart Stores', '315,654.0', '11,231.0']];

            var dataModel = {
                location: "local",
                sorting: "local",
                sortIndx: "OrderID",
                sortDir: "up"
            }

            var obj = {
                width: 840, height: 460,
                dataModel: dataModel,
                wrap: false,
                hwrap: false,
                showBottom: false,
                editable: false,
                selectionModel: { type: 'cell' },
                filterModel: { on: true, mode: "AND", header: true },
                title: "Shipping Orders",
                resizable: true,
                columnBorders: true,
                freezeCols: 2
            };

            obj.colModel = [
                { title: "Rank", width: 100, dataType: "integer" },
                { title: "Company", width: 200, dataType: "string",
                filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'], dataIndx: 'Company' }
                },
                { title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
                { title: "Profits ($ millions)", width: 150, dataType: "float", align: "right" }
            ];
            obj.dataModel = { data: data };

            var $grid = $("#paged_grid").pqGrid(obj);

            $grid.pqGrid("filter", { oper: 'add', data: [] })
            .pqGrid("refresh");
        });
    </script>

Pages: [1]