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 - Ron Hess

Pages: [1] 2
1
I guess my feedback is :

please don't change the API within a minor number revision, this should be reserved for bug fixes.

new or changed API should obvious, 2.1.0  or 2.X.0,  so that i know to read the docs before upgrading.

Thanks for the upgrade docs, the actual API Docs should list the version that each feature is introduced in.

2
Bug Report / pageModel.totalPages -> should be ? ---> dataModel.totalPages
« on: December 09, 2013, 11:40:39 pm »
Total pages was found in dataModel not pageModel

Docs:
var totalPages=$( ".selector" ).pqGrid( "option", "pageModel.totalPages" );


i had to change this to
var totalPages=$( ".selector" ).pqGrid( "option", "dataModel.totalPages" );


to get it to work on 2.0.2

does this change in 2.0.3?  or is the doc incorrect ?

3
Help for ParamQuery Pro / Re: Force.com Visualforce RemoteAction
« on: October 11, 2013, 12:29:19 am »
the main thing is that Force.com Visualforce developers should deepClone records they get back from their RemoteAction methods ( JSON) unless their data is completely flat ( no related info )

i'l attach my deepClone, it's just a javascript clone i picked from stack-exchange


4
Help for ParamQuery Pro / Force.com Visualforce RemoteAction
« on: October 10, 2013, 09:15:01 pm »
I've resolved a tricky bit of debugging, and would share it with users of Force.com platform & ParamQuery

If you are using @RemoteAction methods in your controller to return data to your PQ grid, it works quite well ( related records and all), i can pass the entire JSON array into the grid data model and it all shows up.

the problem is when you edit a row, some of the data ( related objects ) are actually shared memory in the client and edit's on one row can change all the other rows that share that related object. 

This is only an issue if you return fields from related lookups in your JSON.

the fix is to clone the array ( and objects in the array) when you get the data back from your RemoteAction.

i use :

function remotingCallback( result, event)
    {               
        checkErrors( event);
       
        // important, we must unpack the JSON we get from Visualforce, it uses serRefId to avoid sending duplicate
        // copies of identical data, but WE NEED separate data to allow edits on one row to not change other rows...
        result = deepCloneObject( result); 

...
       obj.dataModel = { data: result.lines, paging: 'local' };


5
The 2.0.0a version has fixed this issue, thanks.


6
i can confirm that my code is working with this change to pqgrid.dev.js  ( remove dataIndx:dataIndx)

return cEditable.call(this.element, {
                      rowIndx: rowIndx,
                      rowData:rowData,
                      colIndx:colIndx });

7
Great , thanks  :D

I can confirm that if i check for ui.rowData == undefined in my code, before i use it, that navigation proceeds correctly ( skips over my cell)


8
Yes, i am seeing this now
my callback is looking at ui.rowData, however in this case i see the exception

[15:49:25.112] TypeError: ui.rowData is undefined @ https://c.cs11.visual.force.com/... 733

the debugger shows my editable callback is getting called with incomplete UI object :
 rowData: undefined

see attachment

tracing back thru the call stack i see that isEditableCell is called with objP , and the same object which has rowIndx: NaN

this appears to be the cause of the exception since then rowData is not constructed prior to calling my editable function


9
I've made editable into a function on one column, but now i'm seeing strange pattern in tabbing on this row

i added a function to return true or false, and make cells in a column selectively editable

I expected the tab-to-next input would skip over these fields to the next editable in this same row

instead i saw tabbing works normally until my column, then focus is shifted out of the grid to the bottom navigation elements.

interestingly, this works sometimes, and next i observe that when it allows forward tab nav, it does not work for shift-tab ( back tab)

$colM[7].editable = function (ui) {
       return ( ui.rowData['Product__r']['Pricebook_Entry_Required__c'] == false ) ;
    };

I'm probably missing something, but should i be managing focus if i turn off a cell in a row ?

10
Help for ParamQuery Pro / setting editable == 'function' in column model
« on: October 07, 2013, 12:11:07 am »
i get an exception from this line
--
[11:37:37.209] ReferenceError: dataIndx is not defined @ https://c.cs11.visual.force.com/resource/.... 2272

on our about line 2272 in the 2.0.0 pro src is the call to my function, however dataIndx is not in scope

      if(typeof cEditable=="function"){               
                var rowIndx = objP.rowIndx,
                    rowData=thisOptions.dataModel.data[rowIndx];               
                 return cEditable.call(this.element, {rowIndx: rowIndx, rowData:rowData,colIndx:colIndx, dataIndx:dataIndx });               
           }


i will try to remove dataIndx from this line

11
Help for ParamQuery Pro / Re: jquery autocomplete custom editor
« on: October 06, 2013, 11:44:31 pm »
Yes, i did have editModel:  { keyUpDown : true }, and i actually want that to work , so i'm leaving this true

i now have cellEditKeyDown implemented and this allows me to skip the keyUpDown grid nav feature when i need to for jquery UI widget.

thanks

12
Help for ParamQuery Pro / Re: jquery autocomplete custom editor
« on: October 04, 2013, 08:53:37 pm »
I did not do any special up / down key handling , just the default that the autocomplete widget adds, which navigates the autocomplete menu.

i am not using cellEditKeyDown, from the description this may allow me to avoid the grid's use of these keys if the autocomplete want's to own that event.  I'll try this next.

thanks

13
Help for ParamQuery Pro / Re: custom editor not getting called
« on: October 04, 2013, 08:04:31 pm »
on or about 3965 i am using this code now, appears to work:

if(typeof edtype=="function"){
                inp = edtype.call(that,
                    {
                        $cell: $cell,
                        cellData: cellData,
                        rowData: rowData,
                        colIndx: colIndx,
                        cls: cls,
                        dataIndx: dataIndx
                    }
                );

14
Help for ParamQuery Pro / Re: jquery autocomplete custom editor
« on: October 04, 2013, 08:02:19 pm »
here is the editor that works with ParamQuery open-source, only thing i'm missing is downArrow navigation within the widget, appears to be picked up by grid instead of the ui widget.

var lookupEditor = function ( ui ) {
        var $cell = ui.$cell.css('padding', '0'),
            data = ui.rowData,
            column = this.colModel[ui.colIndx];
           
          var $inp = $("<input type='text' style='padding:2px;border:0;vertical-align:bottom;width:96%;'/>")
            .attr('data-table', ui.dataIndx )
            .attr('data-sobjectid', data.Id)
            .appendTo($cell)
            .val( resolveLookupName(data,ui.dataIndx) ).select()
            .autocomplete({
               source:  function( request, response) {
                    var which = this.element.attr('data-table');
                    if ( which == null ) which ='';
                   
                    Visualforce.remoting.Manager.invokeAction(
                        '{!$RemoteAction.PQGridComp.lookupSearch}',
                        request.term,
                        which ,
                        function(result, event){
                            checkErrors( event);
                            cleanNS( result );
                            values = result;
                            response(values);
                        }
                    );
                },
                delay: 1,
                focus: function( event, ui ) {
                    $(this).val( ui.item.value);
                },
                select: function( event, ui ) {
                    var id = ui.item.id,
                        nam = ui.item.value,
                        sobject = findSobjectById( $(this).attr('data-sobjectid') ),
                  field = $(this).attr('data-table');
                          setLookupIdName( sobject, field, id, nam);
                },
                minLength:2
           });
    }

15
Help for ParamQuery Pro / jquery autocomplete custom editor
« on: October 04, 2013, 09:56:53 am »
I've constructed a custom editor using jquery.autocomplete(), it's mostly working as expected in the open-source version, but now in the Pro version, the down arrow key is not arriving at my plugin , it is getting sent / grabbed by the grid and moving me down a row. 

I like the feature to move down , except when my autocomplete pull down list is open, then i want to keep those keys for my navigation.

Is there a simple way to keep these keystrokes for my editor and not let them be snagged by pqGrid ?

Pages: [1] 2