PDA

View Full Version : How to display chart data in table format in tab panel



m4manas
20 Dec 2011, 8:57 PM
Hi there,
I m trying to make a reporting app based on sencha chart and I m able to get most of the things working. I am facing an issue in displaying the tabular data in the tab panel. Any help suggestion how to go about it.
Thanks

mitchellsimoens
21 Dec 2011, 6:50 AM
I'm not sure I follow. You are having problems with a chart to be across tabs?

m4manas
21 Dec 2011, 7:12 AM
I want to display the json data in table format in another tab of the chart.

mitchellsimoens
21 Dec 2011, 7:13 AM
I want to display the json data in table format in another tab of the chart.

Charts don't have tabs. Do you have a tabpanel with multiple charts under it?

m4manas
21 Dec 2011, 7:14 AM
Yes,
I have a tab panel with multiple chart in it. Like the energy app.

m4manas
22 Dec 2011, 5:48 PM
I found i can use data view inside a panel to display data.
How do i format data in TPL to display in a tabular format.

When i user <table> tags i m getting
undefined is not an object (evaluating c.dragObj.offset Boundary)

Thanks

hermanvandermaas
15 Jan 2012, 12:32 AM
I need a data table of a chart too. Using the <table></table> tags once and have the DataView template fill the table with rows and cells would be the best solution. I didn't find a way to do this though. I found this on the Sencha forum, it makes the DOM bigger and the app slower, but it works: http://www.sencha.com/forum/showthread.php?170944-lt-table-gt-in-DataView.

==
This seems to be the proper way for creating a html table with DataView (found on http://stackoverflow.com/questions/4832621/sencha-touch-access-template-data):


var tpl = new Ext.XTemplate(
'<table id="userTable"',

'<tpl for=".">',

'<tr>',

'<td class="x-view-over">',

'<span class="thumb-wrap">{id}</span>',

'</td>',
'<td class="x-view-over">',

'<span class="thumb-wrap"><a onclick="alert(tpl.name)">{name}</a></span>',

'</td>',


'</tr>',

'</tpl>',

'</table>',

'<div class="x-clear"></div>'
);