PDA

View Full Version : 'minWidth' is null or not an object on IE 8 * Ext JS Library 3.2.1



nikhilesh
21 Jun 2010, 7:34 AM
var Width = 500;
var Height = 500;
var gridForm;




var dsValidateREservation;
var colModelValidateReservation;
GetReservationColumnModel();
dsValidateREservation = new Ext.data.Store({
autoDestroy: true,
url: "proxy.aspx?From=GetReservationForValidation?SchDate=" + document.getElementById('txtSchDate').value,
reader: new Ext.data.XmlReader({
record: 'ResInformation',
fields: [
{name:'ResId', mapping: '@ResId' },
{ name: 'ArvDep', mapping: '@ArvDep' },
{ name: 'ReservationType', mapping: '@ReservationType' },
{name:'ErrorInfo', mapping: '@ErrorInfo'},
{ name: 'ErrorCode', mapping: '@ErrorCode' },
{ name: 'StAddress', mapping: '@StAddress' },
{ name: 'EdAddress', mapping: '@EdAddress' }
//, { name: 'ErrorCode', mapping: '@ErrorCode' }
]
}),

sortInfo: { field: 'ResId', direction: 'ASC' }
});

function GetReservationColumnModel() {

colModelValidateReservation = new Ext.grid.ColumnModel([

{ header: "ResId", width: 70, dataIndex: 'ResId', sortable: true },
{ header: "ArvDep", width: 70, dataIndex: 'ArvDep', sortable: true },
{ header: "StAddress", width: 70, dataIndex: 'StAddress', sortable: true },
{ header: "EdAddress", width: 70, dataIndex: 'EdAddress', sortable: true },
{ header: "Type", width: 70, dataIndex: 'ReservationType', sortable: true },
{ header: "ErrorInfo", width: 160, dataIndex: 'ErrorInfo', sortable: true},
{ header: "ErrorCodeErrorCode", width: 160, dataIndex: 'ErrorCode', sortable: true }
]);

}

dsValidateREservation.load();
var grdValidateReservation = new Ext.grid.GridPanel({
store: dsValidateREservation,
cm: colModelValidateReservation,
// renderTo: 'divGroupingWindow',
width: Width,
height: Height,
title: 'Reservation Info',
frame: true,
loadMask: true,
stripeRows: true,
border: true,
minWidth: 200,
buttons: [{fieldLabel: 'Submit',
style: "padding:0px;",
text: 'Submit',
id: 'btnSubmit',
name: 'btnSubmit',
handler: PopulateReservationBasedOnErrorCode,
clickEvent:'mousedown'},
]

});
function PopulateReservationBasedOnErrorCode() {
var punchid = "";
var flag = false;
var rowSelection;
var SplitVal;
try {
//rowSelection = grdValidateReservation.store.getCount();
for (var i = 0; i < grdValidateReservation.store.getCount(); i++) {
SplitVal = grdValidateReservation.store.getAt(i).data["ErrorCode"].toString().split(",")
document.getElementById("txtReservation").value = grdValidateReservation.store.getAt(i).data["ResId"].toString();
document.getElementById("txtArvDep").value = grdValidateReservation.store.getAt(i).data["ArvDep"].toString();
document.getElementById("txtResType").value = "0"; //grdValidateReservation.store.getAt(i).data["ReservationType"].toString();
document.getElementById("lblSource").innerHTML = grdValidateReservation.store.getAt(i).data["StAddress"].toString();
document.getElementById("lblDestination").innerHTML = grdValidateReservation.store.getAt(i).data["EdAddress"].toString();
break;
}

for (var k = 0; k < SplitVal.length; k++) {

if ((SplitVal[k].toString() == "5" || SplitVal[k].toString() == "6") ) {

alert('<iframe style="height: 360px; width: 340px;" src="../map/mapgeocode.html?resno=' + document.getElementById("txtReservation").value + '&amp;arvdep=' + document.getElementById("txtArvDep").value + '&amp;stopid=-1&amp;type=' + document.getElementById("txtResType").value + '"></iframe>');
document.getElementById("lblGeoCode").innerHTML = '<iframe style="height: 360px; width: 340px;" src="../map/mapgeocode.html?resno=' + document.getElementById("txtReservation").value + '&amp;arvdep=' + document.getElementById("txtArvDep").value + '&amp;stopid=-1&amp;type=' + document.getElementById("txtResType").value + '"></iframe>';
break;
}
}

}
catch (ex) {
alert(ex);
}
finally {
rowSelection = null;
}

}




Ext.onReady(function() {

Ext.QuickTips.init();

// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
var fm = Ext.form;
gridForm = new Ext.Panel({
border: true,
minWidth: '5',
title: 'Other',
id: 'company-form',
margins: '40 0 0 0',
cmargins: '40 5 0 0',
bodyStyle: 'padding:5px 5px 5px 5px',
autoScroll: true,
labelWidth: 100,
collapsible: true,
split: true,
width: Width,
height: Height,
labelWidth: 160,
layout: 'form',
minWidth: 200,

items: [grdValidateReservation],
renderTo: document.getElementById('divReservationInfo')
});



});


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ValidateReservation.aspx.cs"
Inherits="Scheduling_ValidateReservation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Validate Reservation</title>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />

<script type="text/javascript" src="adapter/ext/ext-base.js"></script>

<script type="text/javascript" src="js/ext-all.js"></script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtSchDate" runat="server" Text="05/28/2010"></asp:TextBox>
<asp:TextBox ID="txtReservation" runat="server"></asp:TextBox>
<asp:TextBox ID="txtArvDep" runat="server"></asp:TextBox>
<asp:Label ID="lblSource" runat="server"></asp:Label>
<asp:TextBox ID="txtResType" runat="server"></asp:TextBox>

<asp:Label ID="lblDestination" runat="server"></asp:Label>


</div>
<table cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left" width="50%" valign="top">
<div id="divReservationInfo">
</div>
</td>
<td width="50%" valign="top">
<table width="100" cellpadding="0" cellspacing="0" valign="top">
<tr id="trZipCode" valign="top">
<td valign="top">
<table width="100" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="txtZipCode" runat="server"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr id="trGeoCode" valign="top">
<td valign="top">
<table width="100" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Label ID="lblGeoCode" runat="server"></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

<script type="text/javascript" src="js/ValidateReservation.js"></script>

</form>
</body>
</html>