PDA

View Full Version : aspx<---js???how can i call



Patrick86
4 Feb 2011, 5:42 AM
Hi guys,
I have 2 files:

-.aspx


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

<!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>
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../Application-js/Formulaire-js/Edit.js"></script>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"/>
<script type="text/javascript" src="../../ext-all-debug.js"></script>
</head>
<body>
<h1> This is my first Grid in BS</h1>

<p> It will show you Monoprix's Data </p>

<p> You can see the .js file on <a href="../Application-js/Formulaire-js/Edit.js">Application-js/Formulaire-js/Edit.js</a>.</p>
</body>
</html>


-.js
// JScript File

Ext.onReady(function(){
//Les donnes a charger dans la grid.
var myData = [
['Lait','970' ,'9'],
['Yaourt','270','3'],
['Baguette','190','2']
];
//Data store
var ds = new Ext.data.Store({
reader: new Ext.data.ArrayReader({}, [
{name: 'product',type:'string'},
{name: 'Price',type:'string'},
{name: 'Percentage', type:'string'}
])
});
ds.loadData(myData);
//Les colonnes
var colModel = new Ext.grid.ColumnModel([
{id :'Product',header: "product", width: 160, sortable: true, locked:false, dataIndex: 'product'},
{header: "Price", width: 75, sortable: true, dataIndex: 'Price'},
{header: "Percentage", width: 100, sortable: true, dataIndex: 'Percentage'}
]);

var gridForm = new Ext.form.FormPanel({
layout: 'absolute',
frame: true,
bodyStyle:'padding:5px',
width: 750,
items: [
{ xtype: 'grid',
cm: colModel,
ds: ds,
autoHeight: true
}
]

});
var window = new Ext.Window({
width: 800,
height: 600,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items: gridForm
})
window.show();
});



when running, The grid I did in .js file doesn't appear as this message which annoy me 'Microsoft javascript Runtime error:' EXT' is undefined"
and this 2 warnings: Warning 1 Error updating JScript IntelliSense: C:\Documents and Settings\Soltani\My Documents\Visual Studio 2005\WebSites\AJAXEnabledWebSite1\Application-js\Formulaire-js\Edit.js: 'Ext' is undefined @ 2:0 C:\Documents and Settings\Soltani\My Documents\Visual Studio 2005\WebSites\AJAXEnabledWebSite1\application\Application.aspx 1 1 C:\...\AJAXEnabledWebSite1\
Warning 2 Validation (XHTML 1.0 Transitional): Element 'title' occurs too few times. C:\Documents and Settings\Soltani\My Documents\Visual Studio 2005\WebSites\AJAXEnabledWebSite1\application\Application.aspx 6 2 C:\...\AJAXEnabledWebSite1\
what is the problem?
Ty