One of the most requested features for Grails-UI was inline cell editing for the dataTable component. In order to make this work, you’ll need to have a URL to send the change request. Each row can have its own editor, which can have its own URL for change requests. In this example, I’m using the same url (resolved from a controller and action) for simplicity’s sake.
You can add an editor and/or a formatter to each row. The current valid formatter values are: text, date, number, currency, radio, and dropdown.
Each editor can be provided with a config mapping that will be passed through to the YUI CellEditor object.
Then package with grails package-plugin, and install into your project: grails install-plugin /path/to/snapshot/grails-grails-ui-1.1-SNAPSHOT.zip






7 Comments
Thanks for the effort.
One enhancement that would make this even more useful would be the ability to do “row editing”, i.e., set the whole row in edit mode, instead of one cell at a time.
Great plugin, and the new snapshot functionality looks quite sharp. I am js-challenged, but have made my way to be able to implement a datatable in either straight YUI, or through your much easier plugin.
HOW do I properly configure the back-end controller response? I successfully submit the inline cell change AND update the GORM data on the server, but get an error in the datatable. I assume I am just missing what I need to send as a success code… but I don’t see it mentioned here.
Any help much appreciated, and thanks for your time and effort.
Sean
@seanoc5 Sorry it has taken so long for me to respond. You’ll have better luck by mailing the Grails user list (more info here).
You will want to install FireBug or something like it to see if there is a client side javascript error happening. The JSON format is a bit tricky to get right, but if you follow the example, you should be pretty close.
How do I change the default sort order to DESC?
Thanks.
sortOrder=”DESC”
hello i was trying out the grailsui inline edit features from grailsui1.2Snapshot.
when i put formatter:’text’ and formatter:’number’ everything works fine. But when i try formatter:’date’ the calendar didn’t pop out. Digging in through firebug i get this error when i click on the date on the page.
K.getMonth is not a function
am i parsing in the wrong date format?
i tried MM/dd/yyyy, MM/dd/yy, yyyy-MM-dd and some other weird combination and it still doesn’t work. Help ?
@kai In order to send a date from the server to the GUI within the JSON string the data table expects, you have to massage the date string on the server a bit. There is no proper date string format in JSON, so GrailsUI helps out a bit by giving you a service method to translate your Date object into a string for the JSON transfer. See here:
http://code.google.com/p/guidemo/source/browse/trunk/grails-app/controllers/DemoController.groovy#174
You want to call the grails ui service like so:
grailsUITagLibService.dateToJs(myDateObject)
when you make your json structure.
One Trackback
[...] So now what? Well, working The Google On The Internet Machine revealed that the 1.1-SNAPSHOT has inline cell editing capabilities so I downloaded the 1.1-SNAPSHOT version from the plugin site and installed it from my local drive [...]