none
Comment appeler mon fichier.js depuis ma page.aspx?? RRS feed

  • Question

  • Bonjour mes amis,

    j'ai deux fichiers

    -.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>
    	<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"/>
      <!-- GC -->
      <!-- LIBS -->
      <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
      
      <script type="text/javascript" src="../Application-js/Formulaire-js/Edit.js"></script>
      <!-- ENDLIBS -->
      <script type="text/javascript" src="../../ext-all-debug.js"></script>
    
    </head>
    <body>
    	<h1> This is my first Grid in BSC</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();
    });
    
    
    
    lorsque j'exécute, la grid que j'ai fait avec .js n'apparait pas ainsi que le message d'erreur suivant 'Microsoft javascript Runtime error:' EXT' is undefined"

    et les 2 fautes sont:

    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\

    quel est le probleme?

    Merci

    vendredi 4 février 2011 12:34

Réponses

Toutes les réponses