Skip to main content

how can i passed dynamic data to datatable plz tell me syntax

4 replies [Last post]
gajanan1
Offline
Joined: 2006-12-13
Points: 0

i want to pass dynamic data to datatable how is it possible
give me the correct syntax

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

You need to have the column names as an array of objects and rows as an array of arrays.

Generally the column names are known and you can pass them in in the arguments section as they are specific to the the display the row data would be passed in as the value:

For example:

value="[
['Company 1',71.72,0.02,0.03,'9/1 12:00am'],
['Company 2',29.01,0.42,1.47,'9/1 12:00am'],
['Company 3',29.89,0.24,0.81,'9/1 12:00am']
]" />

If all data (including column names is generated on the server you can provide an object using a service:

Example:

data.jsp
{
columns :[
{title : 'Company'},
{title : 'Price'},
{title : 'Change'},
{title : '% Change'},
{title : 'Last Updated'},
]}
rows : [
['Company 1',71.72,0.02,0.03,'9/1 12:00am'],
['Company 2',29.01,0.42,1.47,'9/1 12:00am'],
['Company 3',29.89,0.24,0.81,'9/1 12:00am']
]

}

Both are valid uses and will work with the dojo.table, dojo.etable, yahoo.grid, and Ext.grid

Let us know if this does not work for you.

Message was edited by: gmurray71

Message was edited by: gmurray71

tazmaniac
Offline
Joined: 2007-03-19
Points: 0

> Both are valid uses and will work with the
> dojo.table, dojo.etable, yahoo.grid, and Ext.grid
>
> Message was edited by: gmurray71

Hi Greg,

I am sorry and a bit desperate :-)
Please accept my appologies for posting twice about this. I admit I am bit frustrated to have such a pretty tool like Jmaki but not being able to use it dynamically.

I guess I am missing the whole point in your answer. I mean, I am asking the same question : how to pass dynamic data to a widget?. And I do not see the way to do it in your answer.
I imagine you are not suggesting to write a data.jsp file containing only the string expected by the value property of a Jmaki widget.

You see, I am looking for dynamically creating the JSON string for any of the widgets you listed.

I am "cooking" the string in a backing bean, and the thing is: the call of backing bean properties is not interpreted inside the jmaki widget declaration.

Is there a fix I could do or is there a syntaxis to know so that the expression #{myBean.myProperty} gets interpreted in the "Value" property string of a Jmaki widget declaration?
Because so far, this is how it gets rendered to the browser:

Thanks in advance.

Alfred

gajanan1
Offline
Joined: 2006-12-13
Points: 0

insted of # sign u use $ sign then its work
it only recognise JSTL tag
value=${Bean.metod}

tazmaniac
Offline
Joined: 2007-03-19
Points: 0

Argh... thank you very much...

Trying all these example without accomplishing result was tiring me.

SO : THANKSSSSSSS !

Alfred