This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Turns map into a javascript config object string for YUI. This is what allows configurations passed into the | |
* grailsUI tag to be passed along to the YUI widget. | |
*/ | |
def mapToConfig(attrs) { | |
attrs.collect { key, val -> | |
// if this is a handler, the val will be a javascript function, so don't quote it | |
if (key == 'handler') return "$key: $val" | |
"'$key': ${valueToConfig(val)}" | |
}.join(",\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YAHOO.util.Event.onDOMReady(function() { | |
var childTableRenderCallback = { | |
success: function(o) { | |
if (o.responseText !== undefined) { | |
// kill off any existing data tables to manage memory | |
if (GRAILSUI.childTable != undefined) { | |
GRAILSUI.childTable.destroy(); | |
} | |
var resultsDiv = document.getElementById('childPanel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderChildTable = function(parentId) { | |
GRAILSUI.childTable.customQueryString = 'id=' + myParentId; | |
var newState = { | |
startIndex: 0, | |
sorting: { // Sort values | |
key: 'id', // or whatever you want the default sort on | |
dir: YAHOO.widget.DataTable.CLASS_ASC | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<gui:menubar> | |
<gui:menuitem url='http://example.com'>Example</gui:menuitem> | |
<gui:submenu label='Foodstuffs'> | |
<gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem> | |
<gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem> | |
<gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem> | |
</gui:submenu> | |
<gui:submenu label='Shoes'> | |
<gui:menuitem url='http://nike.com'>Nike</gui:menuitem> | |
<gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<gui:menu id='myMenu'> | |
<gui:menuitem url='http://example.com'>Example</gui:menuitem> | |
<!-- Grouped and titled --> | |
<gui:menugroup title='Foodstuffs'> | |
<gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem> | |
<gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem> | |
<gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem> | |
</gui:menugroup> | |
<!-- Grouped, no title --> | |
<gui:menugroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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]], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='lineChart' style="width:600px; height: 400px"></div> | |
<gui:lineChart | |
renderTo="lineChart" | |
data="[ | |
[ month: 'January', rent: 880.00, utilities: 894.68 ], | |
[ month: 'February', rent: 880.00, utilities: 901.35 ], | |
[ month: 'March', rent: 880.00, utilities: 889.32 ], | |
[ month: 'April', rent: 880.00, utilities: 884.71 ], | |
[ month: 'May', rent: 910.00, utilities: 879.811 ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='barChart' style="width:600px; height: 400px"></div> | |
<gui:barChart | |
id='myBarChart' | |
renderTo="barChart" | |
data="[ | |
[ year: 2003, revenue: 1246852, expense: 1123359, income: 123493 ], | |
[ year: 2004, revenue: 2451876, expense: 2084952, income: 366920 ], | |
[ year: 2005, revenue: 2917246, expense: 2587151, income: 330095 ], | |
[ year: 2006, revenue: 3318185, expense: 3087456, income: 230729 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='columnChart' style="width:600px; height: 300px"></div> | |
<gui:columnChart | |
id='myColChart' | |
renderTo="columnChart" | |
data="[ | |
[ month: 'Oct', pork: 1354, beef: 1442 ], | |
[ month: 'Nov', pork: 1326, beef: 1496 ], | |
[ month: 'Dec', pork: 1292, beef: 1582 ], | |
[ month: 'Jan', pork: 1387, beef: 1597 ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='pieChart' style="width:600px; height: 400px"></div> | |
<gui:pieChart | |
renderTo="pieChart" | |
data="[ | |
[ response: 'Summer', count: 564815 ], | |
[ response: 'Fall', count: 664182 ], | |
[ response: 'Spring', count: 248124 ], | |
[ response: 'Winter', count: 271214 ], | |
[ response: 'Undecided', count: 81845 ] |
OlderNewer