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

Pages: [1] 2
1
I have a working grid but need to disable an "add" button on the grid toolbar after posted data is inserted into the grid.  To do it, I run a function that gets a recordset from the database and need to parse that JSON to set some local variables.

i know this is simple and really not an issue for the grid itself, but I can't see how to do parse the returned data which looks like:

 {"DATA":[{"logins_remaining":0,"login_count":10}]}

The function is called after the grid refreshes.  Can you provide a hint on how to parse the JSON? 

function refreshLoginCount() {
         
         //get a query recordset of counts from server
      $.get("/_resources/cfc/logins.cfc?method=getActiveLoginCount&account_id=" + $account_id, function(data, status){
 
            // This is the response from server >>   {"DATA":[{"logins_remaining":0,"login_count":10}]}.   
            
            
            // I want to set some Jquery variables, for example >>  $logins_remaining = 0 AND $("#login_count").html("10");
            
            
 
          });
      }

2
Help for ParamQuery Pro / How do i apply formatting before validation?
« on: December 01, 2015, 01:37:06 am »
I have a column that holds US phone numbers that we want to have the format 999-999-9999. 

The column has validations, one of which is to check for hyphens.  I'd like to "help" the user by allowing numbers to be entered without hyphens, and then to validate.  How do i call a function to apply formatting before validation occurs?

The jQuery to add the hyphens to a number string would be something like:  $(this).val($(this).val().replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3'))


My column definition:

{ title: "Phone", width: '15%', dataType: "string", dataIndx : "phone" ,
                      validations: [
                         { type: 'nonEmpty', msg: "Required"},
                         { type: 'regexp', value: "^[0-9]{3}-[0-9]{3}-[0-9]{4}$", msg: "That does not appear to be a valid US phone number in the format 999-333-2222 (add the hyphens please!)" },
                      ]
                    },

3
Help for ParamQuery Pro / Display total records in title bar
« on: November 20, 2015, 02:24:00 am »
How do i display the total number of records in the grid title bar?  See screenshots.

4
Thank you!  That did the trick.

5
I just upgraded to v 3.2.0 in order to use new checkbox attributes, however now my grid has broken.  When changes are made to data, save buttons no longer enable.

This code enables/disables header row buttons to submit or rollback changes:

history: function (evt, ui) {
                var $grid = $(this);
                if (ui.canUndo != null) {
                    $("button.changes", $grid).button("option", { disabled: !ui.canUndo });
                }
                if (ui.canRedo != null) {
                    $("button:contains('Redo')", $grid).button("option", "disabled", !ui.canRedo);
                }
                $("button:contains('Undo')", $grid).button("option", { label: 'Undo (' + ui.num_undo + ')' });
                $("button:contains('Redo')", $grid).button("option", { label: 'Redo (' + ui.num_redo + ')' });
            },


6
Help for ParamQuery Pro / Re: Checkbox to always show?
« on: November 19, 2015, 02:14:54 am »
My version was v3.1.0 .  After upgrading to the latest version, everything now works.  Thank you!

7
Help for ParamQuery Pro / Re: Checkbox to always show?
« on: November 18, 2015, 07:21:17 pm »
Maybe I did something wrong, but I changed the col definition to:
{
     title: "Remove Login?",
     dataIndx: "locked",
          type: 'checkbox',
          dataType: 'bool',
          editor: false
}

This removed the checkbox totally (on click, the field turns into a text field.  See screenshot

8
Help for ParamQuery Pro / Checkbox to always show?
« on: November 18, 2015, 04:10:33 am »
I have a boolean column defined by:

{ title: "Remove Login?",  width: 100, dataType: "bool", align: "center", dataIndx: "locked",
                    editor: { type: "checkbox", subtype: 'double', style: "margin:3px 5px;" },
                    validations: [{ type: 'nonEmpty', msg: "Required"}]
}

Is it possible to have the checkbox always show, rather than make the user click to show it?  (See screenshot)

9
Help for ParamQuery Pro / Re: Clear Filters in Grid
« on: October 06, 2015, 03:21:36 am »
Thanks,

I tried the code block and it reset almost every filter, however one of my filters is a date range.  Your code cleared the first but not the second of the dates.

10
Help for ParamQuery Pro / Clear Filters in Grid
« on: October 01, 2015, 10:16:05 pm »
I searched in the forums for how to clear added grid filters and found only one old post about this http://paramquery.com/forum/index.php?topic=519.msg3184;topicseen#msg3184, where the solution was to add $grid.pqGrid( "filter", { oper:'replace', data: [] } ); to the click event for the toolbar button.

That works to clear the filters from the grid and restore the data, however it leaves the text typed into the filter text fields.  How do I clear out this text?

toolbar:

{ type: 'button', label: 'Clear Filters', listeners: [
     {
      "click": function (evt, ui) {

          $grid.pqGrid( "filter", { oper:'replace', data: [] } );

       }
 }
]
},

11
I have 2 outstanding issues.   It turns out the real problem with BOTH was the type of JSON format that Coldfusion was returning to the grid. Once I figured that out, I was able to access the other column data with no problem.  That solves this issue.  The other issue had to do with the "red icon" indicator for changed data.  Once this was solved, that one was solved too.

12
When i replace dataIndex with dataIndx, all of the values disappear from my grid.  The grid displays the correct number of records, but the values do not appear.  If I change back to dataIndex, then all the data cells are populated.

My JSON looks like, which corresponds to the order of columns in the colModel:

{"COLUMNS":["ADMIN_LOGIN_ID","FNAME","LNAME","EMAIL","PHONE","PHONE_EXT","PASSWORD","DATE_PASSWORD_CHANGED"
],"DATA":[[474,"Tami","Alleman","[email protected]","541-988-0227","482","David33","May, 08
 2014 20:59:01"],[453,"Patricia","Atkins","[email protected]","541-465-8135","135","Atkinspatricia1"
,"April, 01 2011 00:00:00"],[372,"Barb","Barnard","[email protected]","541-465-8175","175","Realtress421"
,"March, 04 2014 15:51:56"],[386,"David","Baslaw","[email protected]","541-465-8116","116","2014Noah"
,"July, 14 2014 18:02:06"]......

13
Help for ParamQuery Pro / Re: Dirty Cells Red Icon missing in PQ Pro
« on: September 29, 2015, 12:52:42 am »
I replaced all the files, emptied my cache and reran the grid, but the red icon is still not showing.  In addition, the cell in which i know data was changed does not have class "pq-cell-dirty" in Firebug.  What else can I check?

Also, the toolbar buttons show the correct number of changes made.  See screenshot

14
There may be an error elsewhere, but I have this code in the callback code.

validations: [

   { type: function (ui) {
                var value = ui.value;
                var idvalue = ui.rowData.admin_login_id;

      alert(value);  -- this is defined and gives the correct value for the selected cell
      alert(idvalue);  -- this is UNdefined
      var validationresp = false;
      var validationmsg = "";

The column model for the ID is.  Do I have that defined correctly?

colModel: [
                { title: "ID", width: 50, dataType: "integer", editable: false , hidden: false , dataIndex: "admin_login_id"  },

15
Help for ParamQuery Pro / Dirty Cells Red Icon missing in PQ Pro
« on: September 24, 2015, 10:11:46 pm »
I just installed my pro grid and somehow lost the little red corner icon that indicates data has changed.

(I previously had the pro demo installed, and the red square showed).

I replaced the theme folder, and the core .js and .css files from the Pro Downloads here on the forums.


Pages: [1] 2