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

Pages: [1]
1
ParamQuery Pro Evaluation Support / Re: Autocomplete for multiple columns
« on: November 10, 2016, 11:16:56 pm »
Thanks!

2
ParamQuery Pro Evaluation Support / Autocomplete for multiple columns
« on: November 09, 2016, 05:02:08 am »
Hi, I am using Autocomplete from the following example:  http://paramquery.com/pro/demos/editing_custom and wants to add support for many columns.

The code below supports column books and the countries. How can I add more local? Say that I have two columns (books, author) and I have one variable for each containing the values for Autocomplete.

It seems like the source can be defined in a dynamic way, but how does that syntax work?

Code: [Select]
source: (ui.dataIndx == "books" ? books : "/pro/demos/getCountries")
Can I add this to the same function below or is it recomended to add a separate function for each column?



 
Code: [Select]
       var autoCompleteEditor = function (ui) {
            var $inp = ui.$cell.find("input");

            //initialize the editor
            $inp.autocomplete({
                source: (ui.dataIndx == "books" ? books : "/pro/demos/getCountries"),
                selectItem: { on: true }, //custom option
                highlightText: { on: true }, //custom option
                minLength: 0
            }).focus(function () {
                //open the autocomplete upon focus               
                $(this).autocomplete("search", "");
            });
        }

BR

3
ParamQuery Pro Evaluation Support / Re: Problem adding data in remote
« on: November 09, 2016, 01:11:37 am »
Thank you! Current toolbar code looks as follows. I understand now that the edit shall take place after load event. But I still don't understand how to modify "New Product" button event below to actually do this; when using remote. Please advice.

            toolbar: {
                items: [
                    { type: 'button', icon: 'ui-icon-plus', label: 'New Product', listener: function () {
                            //append empty row at the end.                           
                            var rowData = { ProductID: 34, UnitPrice: 0.2 }; //empty row
                            var rowIndx = grid.addRow( { rowData: rowData, checkEditable: true });
                            grid.goToPage({ rowIndx: rowIndx });
                            grid.editFirstCellInRow({ rowIndx: rowIndx });                       
                        }
                    },
                    { type: 'separator' },
                    { type: 'button', icon: 'ui-icon-disk', label: 'Save Changes', cls: 'changes', listener: function () {
                            saveChanges();
                        },
                        options: { disabled: true }
                    },
                    { type: 'button', icon: 'ui-icon-cancel', label: 'Reject Changes', cls: 'changes', listener: function () {
                            grid.rollback();
                            grid.history({ method: 'resetUndo' });                       
                        },
                        options: { disabled: true }
                    },
                    { type: 'button', icon: 'ui-icon-cart', label: 'Get Changes', cls: 'changes', listener: function () {
                            var changes = grid.getChanges({ format: 'byVal' });
                            if( console && console.log) {
                                console.log(changes);
                            }                           
                            alert("Please see the log of changes in your browser console.");                       
                        },
                        options: { disabled: true }
                    },
                    { type: 'separator' },
                    { type: 'button', icon: 'ui-icon-arrowreturn-1-s', label: 'Undo', cls: 'changes', listener: function () {
                            grid.history({ method: 'undo' });
                        },
                        options: { disabled: true }
                    },
                    { type: 'button', icon: 'ui-icon-arrowrefresh-1-s', label: 'Redo', listener: function () {
                            grid.history({ method: 'redo' });                       
                        },
                        options: { disabled: true }
                    }
                ]
            },

4
ParamQuery Pro Evaluation Support / Problem adding data in remote
« on: October 31, 2016, 07:29:34 am »
Hi,

I am trying the http://paramquery.com/pro/demos/editing_batch but needs to run from remote paging instead of local. I understand that the following two lines have to be changed:
grid.goToPage({ rowIndx: rowIndx });
grid.editFirstCellInRow({ rowIndx: rowIndx });

I managed to change the first so it actually goes to the last page of the pageModel.
grid.goToPage({ page: grid.option('pageModel.totalPages') });

However I need to click on the add button again in order to add the row. Ant it is not in focus so I need to scroll to the end of the list to actually see the added line.

So my question is - can I change also the second line of code above in order to get focus of the added line?

Many thanks in advance!

BR

Pages: [1]