ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: bmais on November 05, 2013, 06:28:11 am
-
Is there a way to fire the saveEditCell when the grid looses focus? My users will edit a cell and then click elsewhere on the form. The cellUnSelect event is ignored.
Thanks
-
Bill
You can use on jQuery API http://api.jquery.com/on/ (http://api.jquery.com/on/) to add delegate blur event something like this
$( document ).on ( "blur", ".pq-editor-focus", function(evt){
var $grid = $(this).closest(".pq-grid");
$grid.pqGrid("saveEditCell");
});
you may need to make minor adjustments to this code.
-
We just noticed this code messes with the grid calendar.
The calendar displays but you cannot choose a date.
The error message is:
Uncaught Missing instance data for this datepicker
We modified your code as follows:
$( document ).on ( "blur", ".pq-editor-focus", function(evt){
var $grid = $(this).closest(".pq-grid");
//$grid.pqGrid("saveEditCell");
$grid.pqGrid("quitEditMode");
});
Any thoughts?
Thanks,
Bill
-
Any editor which requires the focus outside of the textbox to function would be problematic e.g. datepicker, autocomplete.
datepicker can be excluded from this rule:
$(document).on("blur", ".pq-editor-focus:not(.hasDatepicker)", function (evt) {
var $grid = $(this).closest(".pq-grid");
//$grid.pqGrid("saveEditCell");
$grid.pqGrid("quitEditMode");
});