No implementation of DataEvents in Lib.web.mvc

34 Views Asked by At

please I need try the DataEvents function in Lib.Web.mvc but is no implemented or I don't know how to use this is my code. I use jqGridImport because I generate the columns dynamically

IList<JqGridColumnDataEvent> lstDataEvents = new List<JqGridColumnDataEvent>();
                            lstDataEvents.Add(new JqGridColumnDataEvent("keypress", "function(e) { soloNumeros() }", null));
jqm = new JqGridColumnModel(NombreColumna) { Index = NombreColumna, Width = 60, Editable = true, Alignment = JqGridAlignments.Right, EditType = JqGridColumnEditTypes.Text, Searchable = false, EditRules = new JqGridColumnRules() { Required = true, Number = true }, Sortable = false, EditOptions = new JqGridColumnEditOptions() { DataEvents = lstDataEvents } };

1

There are 1 best solutions below

1
tpeczek On BEST ANSWER

There is no way to use DataEvents and jqGridImport.

The jqGridImport functionality grabs the whole jqGrid configuration by using AJAX request which returns JSON and then builds jqGrid based on that. DataEvents represent reference to JavaScript functions which should handle specific events - there is no way to pass reference to a function in JSON payload (there are some theoretical workarounds with eval etc. but jqGrid would have to natively support that and it doesn't).