PDA

View Full Version : passing dynamic html table to ext tablegrid



wattyf
20 Apr 2011, 8:05 AM
hi, i'm new to ext and i'd appreciate help on this issue.
I'm trying to add a dynamic html table to an ext tablegrid in a window using a javscript variable instead of static html.
the javascript variable contains a html table. i try to add this variable to the ext.ux.grid.tablegrid constructor and i get the "table is null" error.


i'm using an ajax post to query a database and return a html table. this table is assigned to the global variable htmlTableData.



$.ajax({
type: "POST",
success: function(polyData){
htmlTableData = polyData;
},
async: false
});


i try to add this table to the grid but returns error "table is null" from tablegrid.js
i have a static html table defined in the html file with id="the-table" and this renders to the grid no problem but when i try to use the js variable instead it fails.

var grid = new Ext.ux.grid.TableGrid(htmlTableData, {
\\var grid = new Ext.ux.grid.TableGrid("the-table", {
stripeRows: true,
autoWidth: true,
frame: true
});

dataTableWin.add({
items: [grid]
});


Please help,
Cheers.

wattyf
26 May 2011, 1:46 AM
Resolved.

fay
26 May 2011, 2:35 AM
Can you post how you solved your problem when you do find a resolution; it might help other folk in the same boat. See also: http://www.sencha.com/forum/showthread.php?131516-Load-Mask-not-working&p=606462&viewfull=1#post606462

wattyf
18 Jul 2011, 6:04 AM
Apologies.
If anyone is having a similar issue, please post a message here and i will provide the solution.
I'd detail it now but would have to go back and check how i resolved it and i don;t have time at the minute.