View Full Version : problem in Mozilla

25 Oct 2006, 5:16 AM
I'm trying to make loadable grid like in the sample "A Grid Component for Yahoo! UI - Part 2"
in IE everything works fine, but in Mozilla Firefox (v page makes full refresh when I load new datas from other xml. What to do?

I use yui_0.11.4 & yui-ext.32.3.1

html file:

<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript" src="/js/yahoo/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/animation/animation-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/connection/connection-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/dom/dom-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/event/event-min.js"></script>
<script type="text/javascript" src="/js/yahoo/build/slider/slider-min.js"></script>

<script type="text/javascript" src="/js/yahoo.ext/yui-ext.js"></script>
<link rel="stylesheet" type="text/css" href="/js/yahoo.ext/resources/css/grid.css"/>


<div id="grid-example" style="width:534px;height:250px;overflow:hidden;position:relative;"></div>
<form name="example-form">
<input type="text" id="author_" value="Sidney Sheldon" size="24" >
<input type="submit" value="load new data"><span id="load-ind" class="loading-indicator" style="visibility:hidden;">Loading...</span>
<script type="text/javascript" src="grid-example-xml.js"></script>


var XmlExample = {
init : function(){
var schema = {
tagName: 'Item',
id: 'ASIN',
fields: ['Author', 'Title', 'Manufacturer', 'ProductGroup']
this.dataModel = new YAHOO.ext.grid.XMLDataModel(schema);

// example of custom renderer function, this hideous code was grabbed off the web
function money(mnt) {
mnt -= 0;
mnt = (Math.round(mnt*100))/100;
mnt = (mnt == Math.floor(mnt)) ? mnt + '.00' : ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt);
return "$" + mnt;

// the DefaultColumnModel expects this blob to define columns. It can be extended to provide
// custom or reusable ColumnModels
var myColumns = [
{header: "Author", width: 120, sortable: true},
{header: "Title", width: 200, sortable: true},
{header: "Manufacturer", width: 120, sortable: true},
{header: "Product Group", width: 100, sortable: true}
var colModel = new YAHOO.ext.grid.DefaultColumnModel(myColumns);

// create the Grid
this.grid = new YAHOO.ext.grid.Grid('grid-example', this.dataModel, colModel);

onLoad : function(){

search : function(e){
var author = getEl('author_').dom.value;
alert("Author can't be blank, nice try buddy!");
// params can be url encoded string or an object
var params = {'author': author};
// use callback to clear loading indicator
// this.dataModel.load('sheldon.xml?222', params, this.clearIndicator);

clearIndicator : function(file){
YAHOO.util.Event.on(window, 'load', XmlExample.init, XmlExample, true);

YAHOO.util.Event.onAvailable('example-form', function(){
getEl('example-form').mon('submit', XmlExample.search,
XmlExample, true);

25 Oct 2006, 7:26 AM
Try adding the id "example-form" to the form element. Maybe firefox can't find it thru DOM by the name.

25 Oct 2006, 7:46 AM
Try adding the id "example-form" to the form element. Maybe firefox can't find it thru DOM by the name.

that works! thanks a lot!