ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: suvalkon on September 01, 2014, 08:54:52 am
-
Hi
I am having a problem with autocomplete in a secondary (child) grid that comes from an external source and needs to be stored prior to usage in child grid.
How can I store it and use it later when the grid control is invoked.
The initial AJAX/JSON is done on entry into the page which gets data for multiple autoCompletes and selects (only once).
I have looked at your example with following code and am not sure how to get it to work for the situation I describe.
It is getting into this function but not setting up the source: attribute properly.
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", "");
});
}
Also when you refresh the child grid ViewandData how can some of the same data also present in the primary grid (current row) be refreshed at the same time?
ie some data in child grid is editable and this needs to be immediately propagated to primary grid view on Update click.
Regards
Nick.
-
1) If you store data for auto complete in a x variable, it could be assigned to autocomplete by source property.
var autoCompleteEditor = function (ui) {
var $inp = ui.$cell.find("input");
//initialize the editor
$inp.autocomplete({
source: x,
selectItem: { on: true }, //custom option
highlightText: { on: true }, //custom option
minLength: 0
}).focus(function () {
//open the autocomplete upon focus
$(this).autocomplete("search", "");
});
}
2) Row can be refreshed / updated with the following methods:
http://paramquery.com/pro/api#method-refreshRow
http://paramquery.com/pro/api#method-updateRow
-
Trying to save Json into array crashes at the source. Have you any example which stores json successfully for use later as a variable?
-
In this example array is stored in a variable books which is being used in autocomplete.
http://paramquery.com/pro/demos/editing_custom