PDA

View Full Version : Grid no longer works with .33 Beta?



dflkid
7 Nov 2006, 3:50 PM
My grid stopped working when I started using the Beta yui-ext.js. I can switch to .33 and it works fine, then to .33 Beta and it doesn't render (Only columns). Were there any changes to the grid? My code is below...



var DataGrid = {
init : function(){

//Set up grid headers
var urlColList = [
{header: "ID", width: 30, sortable: true},
{header:"CDRL #", width: 90, sortable: false},
{header:"SubTitle", width: 150, sortable: false},
{header:"Type", width: 60, sortable: true},
{header:"Submittal Author", width: 90, sortable: false},
{header:"Event", width: 75, sortable: false},
{header:"Freq", width: 60, sortable: false},
{header:"IPT", width: 60, sortable: false},
{header:"Due to DM", width: 60, sortable: true},
{header:"Submitted to DM", width: 90, sortable: true},
{header:"Due To Customer", width: 90, sortable: true},
{header:"Submitted To Customer", width: 90, sortable: true},
{header:"Current Status", width: 75, sortable: true}
];
var urlCM = new YAHOO.ext.grid.DefaultColumnModel(urlColList);

//Set up remote data format
var urlSchema = {
tagName: 'cdrl',
id: 'use-index',
fields: ['CDRLID', 'CDRLNUMBER', 'CDRLSUBTITLE', 'CDRLTYPE', 'SUBMITTALAUTHOR', 'EVENTENDDATE', 'FREQ','IPTABBREV', 'DAYSDUETODM', 'AuthorSubmitDate', 'DuetoCust', 'CustSubmitDate', 'StatusText']
};
urlDM = new YAHOO.ext.grid.XMLDataModel(urlSchema);
urlDM.setDefaultSort(urlCM, 1, 'ASC');

urlSM = new YAHOO.ext.grid.SingleSelectionModel();
urlGrid = new YAHOO.ext.grid.Grid('feed-list', urlDM, urlCM);
urlGrid.render();
urlDM.load('cdrl_xml.cfm');
}

}
YAHOO.ext.EventManager.onDocumentReady(DataGrid.init, DataGrid, true);[/code]

jack.slocum
7 Nov 2006, 4:09 PM
Your code looks fine. All my grids on this site are rendering properly. Can you put up a link where I can see the problem?

Thanks,Jack

dflkid
7 Nov 2006, 4:13 PM
Unfortunately it's on our intranet, so there's no public access. The grid is in a borderlayout and I just discovered that the grid appears if I resize the browser. I know that's not much to go on, sorry.

jack.slocum
7 Nov 2006, 4:19 PM
AHHH, that is a bug in the GridPanel I just fixed. I will have a build up shortly with the correction.

Can you try plugging in this file:

http://www.jackslocum.com/build/yui-ext_33-beta3.2.1.js

and tell me if it fixes it?

dflkid
7 Nov 2006, 4:30 PM
No dice. :(

jack.slocum
7 Nov 2006, 4:31 PM
Grab the new build I put up (beta 4).

dflkid
7 Nov 2006, 4:57 PM
Still no luck. I'll play around with it some more tomorrow and look for anything boneheaded I may be doing to cause this.

digerata
7 Nov 2006, 5:05 PM
I wasn't having a problem with grids, but this beta4 fixed a bunch of layout issues with tabs and the borderlayout under IE.

Nice Jack!

dflkid
8 Nov 2006, 10:54 AM
So I found the solution, and I'm not sure if it's intended functionality or not. In my code I also had some container layout code and the...


YAHOO.ext.EventManager.onDocumentReady(DataGrid.init, DataGrid, true);

was above the container bit...


YAHOO.ext.EventManager.onDocumentReady(Example.init, Example, true);

So the fix was putting the datagrid onDocReady below the container onDocReady like so...


YAHOO.ext.EventManager.onDocumentReady(Example.init, Example, true);
YAHOO.ext.EventManager.onDocumentReady(DataGrid.init, DataGrid, true);

Now the grid shows up on page load. :D

jack.slocum
8 Nov 2006, 5:45 PM
Good catch. You may want to consider having a single initialization point that calls to the other spots.