Skip to content

Instantly share code, notes, and snippets.

@rhyolight
Created January 30, 2009 03:20
Show Gist options
  • Save rhyolight/54917 to your computer and use it in GitHub Desktop.
Save rhyolight/54917 to your computer and use it in GitHub Desktop.
Grails-UI DataTable with inline cell editing
<gui:dataTable
draggableColumns="true"
id="dt_3"
columnDefs="[
[id:'ID', formatter:'text', sortable:true, resizeable: true],
[name:'Name', formatter:'text',
editor:[controller:'demo', action:'tableChange', config:[disableBtns:true]],
sortable:true, resizeable: true],
[birthDate:'Birth Date', formatter:'date',
editor:[controller:'demo', action:'tableChange', config:[disableBtns:true]],
sortable:true, resizeable: true],
[age:'Age', formatter:'number',
editor:[type:'dropDown', controller:'demo', action:'tableChange',
config:[dropdownOptions: (21..50), disableBtns:true]],
sortable:true, resizeable: true],
[netWorth:'Net Worth', formatter:'currency', sortable:true, resizeable: true],
[isDumb:'Some Flag', sortable:true, resizeable: true],
[favoriteColors:'Favorite Colors',
editor:[type:'checkbox', controller:'demo', action:'tableChange', config:[checkboxOptions:['red','yellow','blue']]],
sortable:true, resizeable: true],
[gender:'Gender',
editor:[type:'radio', controller:'demo', action:'tableChange', config:[radioOptions:['male','female']]],
sortable:true, resizeable: true],
[radio:'Radio format', formatter:'radio', sortable:true, resizeable: true],
[drop:'Drop Down', formatter:'dropdown', dropdownOptions:['apple','banana','orange','peach'], sortable:true, resizeable: true]
]"
sortedBy='crap'
allowExclusiveSort='true'
controller="demo" action="dataTableDataAsJSON"
rowsPerPage="15"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment