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

Pages: [1] 2
1
ParamQuery Pro Evaluation Support / SetSelection does not work
« on: July 08, 2014, 08:21:29 am »
When I try to set the selection nothing happens. The same line works in the console after the grid has already loaded, but whether I put the setSelection call after or before the grid initializing it still does not work. The grid is being loaded via an ajax call so i tried to bind to the load event but it still does not work.

Code: [Select]
obj.create = function (evt, ui) {
            $("#grid_editing").pqGrid("setSelection", { rowIndx: 1 });
        }

var $grid = $('#grid_editing').pqGrid(obj);

Does the grid not allow you to set the selection if you are loading via ajax? I have tried in the load event

Code: [Select]
load: function(event, ui) {
                 $('#grid_editing').pqGrid('setSelection', { rowIndx: 1 });
            },

And also binding to the load event like this. No matter what I try it doesn't set the selected row but again if I run the same code through the console it will select the row so I know the syntax and data is correct it just appears to be an issue with grid itself unless I am missing something but I have tried almost everything I can think of at this point.

Code: [Select]
$( "#grid_editing" ).on( "pqgridload", function( event, ui ) {$('#grid_editing').pqGrid('setSelection', { rowIndx: 1 });} );

2
I have a filter on the column below using an autoCompleteEditor, however, when the selection is changed the change event does not fire. Only if you actually type something else into the text box and hit enter will the event fire. None of the demo examples are using the autocomplete filter so I am wondering is this a limitation of the listeners or the grid itself?

{
                title: 'Facility', width: 150, dataIndx: 'FacilityName', dataType: 'string',
                editor: {type: 'select',options: facilities,},
                filter: { type: 'textbox', condition: "contain", init: autoCompleteEditor, listeners: ['change'] }
}


        var autoCompleteEditor = function (ui) {
            $(this).autocomplete({
                source: facilities,
                selectItem: { on: true },
                highlightText: { on: true },
                minLength: 0,               
            }).focus(function () {
                $(this).autocomplete("search", "");
            });
        }

3
ParamQuery Pro Evaluation Support / Re: Bind Select editor to Object
« on: June 24, 2014, 06:25:31 am »
Can you point me to an example of this? I tried using the below where facilities is valid JSON data and the select list is empty

editor: {
                    getData: function () { return facilities },
                    type: 'select'
                }

4
ParamQuery Pro Evaluation Support / Bind Select editor to Object
« on: June 23, 2014, 10:23:10 am »
I am rendering an object to a cell, and then binding a select editor with a list of strings. However, I would like to bind the select editor with a list of objects, the same type of object that is binded to the actual cell. Can this be done? Reason I want to do this is so that when the update goes back to the server with a new value, I can have the primary key id of the object instead of just the string value that I have now.

        var colM = [
            {
                title: 'Facility', width: 100, dataIndx: 'FacilityName', dataType: 'string',
                editor: {
                    type: 'select',
                    options: facilities,
                },
                render: function (ui) {
                    return ui.rowData['Facility']['Name'];
                }
            },

5
When I change the selection of a select list and tab away or change cells, the selected value is lost and cell displays the original value. Any ideas why this is happening and how to correct? Here is the column and a few drop down values for the editor

 var colM = [
 {
                title: 'Facility', width: 100, dataType: 'string',
                editor: {
                    type: 'select',
                    options: FacilityName
                },
                render: function (ui) {
                    return ui.rowData['Facility']['Name'];
                }
            },

var FacilityName = ['random', 'acts'];

6
ParamQuery Pro Evaluation Support / Re: IsDirty is always False
« on: June 23, 2014, 09:53:32 am »
recIndx was spelled incorrectly as recIndex, after I corrected that it works.

7
ParamQuery Pro Evaluation Support / IsDirty is always False
« on: June 23, 2014, 09:08:49 am »
When I get data via Ajax, isDirty is always false. I am setting the PrimaryKeyId in the datamodel below, all the data is populating the grid correctly. I can even write the primaryKey to the console or display via data[0].PersonId so I know the data is there. What am I missing? My primary key is a Guid, does param query not work with Guids as the primary key?


var providers = {
            location: 'remote',
            dataType: "JSON",
            recIndex: 'PersonId',
            method: "GET",
            url: "/FacilityAdmin/Provider/GetProviders",
            getData: function (dataJSON) {
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
            }
        };

 var colM = [
            { title: 'PersonId', width: 100, dataIndx: 'PersonId', dataType: 'string', hidden: true },
            { title: 'Last Name', width: 100, dataIndx: 'LastName', dataType: 'string' },
            { title: 'First Name', width: 100, dataIndx: 'FirstName', dataType: 'string' },

8
ParamQuery Pro Evaluation Support / Re: JSON Data with Child Objects
« on: June 23, 2014, 08:46:59 am »
Thanks that works :)

9
ParamQuery Pro Evaluation Support / JSON Data with Child Objects
« on: June 23, 2014, 07:22:20 am »
I have JSON being returned to the grid and the top level JSON object is binding correctly. However, if I try to bind to the Child object properties it does not work . For example, the Facility.Name is not being set, but the last and first names are. If I write data[0].Facility.Name to the console I am able to see the child object property so I know the data is there and valid. How is this handled with param query?

        var colM = [
            { title: 'Last Name', width: 100, dataIndx: 'LastName', dataType: 'string' },
            { title: 'First Name', width: 100, dataIndx: 'FirstName', dataType: 'string' },
            { title: 'Facility', width: 100, dataIndx: "Facility.Name", dataType: 'string' },
        ];

10
Do the event listeners not work for Editor Select elements? The below 'change' function does not execute when I change the selection.

            colModel: [
                {
                    title: 'Data Type', width: 100, dataIndx: 'DataType',
                    editor: {
                        type: 'select',
                        options: ['Express Lane', 'Package Us', 'Safe Face'], listeners: [{
                            change: function (evt, ui) {
                                alert('it worked!');
                            }
                        }],
                    }
                },

11
After I save changes, if I do not reload the entire grid, then the dirty cells are reset back to the original values, and it forces me to have to reload the grid. I do not want to reload the grid again and I do not want the dirty cells to reset the data after I save, how do I prevent this?

12
After I click Accept changes, make an ajax call to save the data, the dirty rows/cells are reset back to their original values instead of the newly saved values. The code examples in the demos show that the entire grid is reloaded with data stored in session. Why would you want to reload the entire grid when you have maybe only updated one cell? Is there not a way to leave the grid with newly saved data and not have to reload the entire again?

13
ParamQuery Pro Evaluation Support / Re: pq-cell-dirty
« on: June 18, 2014, 09:52:53 am »
I found that recIndx needs to be set to the PrimaryKey value in order for IsDirty to work.

14
ParamQuery Pro Evaluation Support / pq-cell-dirty
« on: June 18, 2014, 09:18:06 am »
How do you get the pq-cell-dirty class to be automatically assigned when you edit a cell? I see this class being assigned on the demos, but I have copied and pasted all of the javascript but still the class pq-cell-dirty does not get assigned. Then when I call the following below, isDirty is false even though I have edited one or more cells

            var isDirty = $grid.pqGrid("isDirty");
            if (isDirty) {

15
ParamQuery Pro Evaluation Support / Re: Hidden Property Not Working
« on: June 18, 2014, 08:42:04 am »
So when I get row data to save an edited row, will I have access to the hidden field data?

Pages: [1] 2