Hi!
In the same project I have two jsp files about jqgrid. On the fields “date” in the Demo version of guriddo that I have in my project display the calendar datepicker well.
However, it does not work when I generate the colName, colModel and colData dynamically.
I have been suggested this web (http://stackoverflow.com/questions/5171617/how-to-add-custom-formatter-for-jqgrid-with-dynamic-column-binding/5175127#5175127) but it seems that is used to modify the value in the table and not to generate additional code in the ‘dataInit’ property.
Code demo is http://www.guriddo.net/demo/guriddojs/edit_add_delete/dialogs_edit_controls/index.html
My code in Java:
StringBuilder functionDate = new StringBuilder();
functionDate.append(” function (element) { $(element).datepicker({ “);
functionDate.append(” id: ‘” + nombre + “_datePicker’, “);
functionDate.append(” dateFormat: ‘” + Constantes.JQGRID_FORMAT_DATE + “‘, “);
functionDate.append(“}); }”);
editOptionsCol.put(“dataInit”, functionDate.toString());
(dataInit into editoptions and editoptions into colModel)
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top