Simple things should be simple. Cose semplici deve essere semplice. While starting with ExtJS, I saw a screencast on Grid which used a rather dubious method of making an AJAX call using an actual form element. Mentre a partire ExtJS, ho visto uno screencast sulla griglia che ha utilizzato un metodo piuttosto dubbia di rendere un AJAX chiamata utilizzando un vero e proprio elemento di forma. I hunted for a better option and I came across a better option - Ext.data.Connection. I caccia per una migliore opzione e mi sono imbattuto in una migliore opzione - Ext.data.Connection. Here’s an working example on how you can easily make AJAX call in ExtJS library. Ecco un esempio di come si può facilmente rendere AJAX ExtJS chiamata in biblioteca.

 var conn = new Ext.data.Connection(); conn.request({     url: 'history.jsp',     method: 'POST',     params: {"metaID": metaID, columnName: field},     success: function(responseObject) {         showHistoryDialog(responseObject.responseText);     },      failure: function() {          Ext.Msg.alert('Status', 'Unable to show history at this time. Please try again later.');      } }); var conn = new Ext.data.Connection (); conn.request ((url: 'history.jsp', il metodo: 'post', params: ( "metaID": metaID, ColumnName:) campo, il successo: funzione (responseObject ) (ShowHistoryDialog (responseObject.responseText);), in caso di avaria: function () (Ext.Msg.alert ( 'Statuto', 'Impossibile mostrare la storia in questo momento. Riprova più tardi.');))); 

Obviously you will have to implement the showHistoryDialog() method to your taste. Ovviamente si dovranno attuare la showHistoryDialog () metodo al vostro gusto. Change the method names and url to suit your requirements. Cambiare il metodo di nomi e url per soddisfare le vostre esigenze.

The downside is that it doesn’t display a loading message which you can easily implement. L'aspetto negativo è che non visualizza un messaggio di carico che è possibile implementare facilmente.

Update: Aggiornamento:
Here is the full code showing a Loading dialog too: Ecco il codice completo che mostra una finestra di dialogo Caricamento troppo:

 var conn = new Ext.data.Connection();      // History buton click handler. var conn = new Ext.data.Connection (); / / Storia buton fare clic su gestore. It submits the request and displays the response using history dialog     function showHistory() {         if(record != null && field != null) {             metaID = record.get("MetaID");             grid.getGridEl().mask('Loading history...');             conn.request({                 url: 'history.jsp',                 method: 'POST',                 params: {"metaID": metaID, columnName: field},                 success: function(responseObject) {                     showHistoryDialog(responseObject.responseText);                     grid.getGridEl().unmask(true);                 },                 failure: function() {                     grid.getGridEl().unmask(true);                     Ext.Msg.alert('Status', 'Unable to show history at this time. Please try again later.');                 }             });         }     } Essa sostiene la richiesta e la risposta viene visualizzata la finestra di dialogo con la storia funzione showHistory () (if (record! = Null & & campo! = Null) (metaID = record.get ( "MetaID"); grid.getGridEl (). Maschera ( 'Caricamento in corso storia ...'); conn.request ((url: 'history.jsp', il metodo: 'post', params: ( "metaID": metaID, ColumnName:) campo, il successo: funzione (responseObject) (showHistoryDialog (responseObject . responseText); grid.getGridEl (). smascherare (true);), in caso di avaria: function () (grid.getGridEl (). smascherare (vero); Ext.Msg.alert ( 'Statuto', 'Impossibile mostrare storia questo momento. Riprova più tardi. ');)));)) 

Note: The code is used in a production environment to display historical information. Nota: Il codice è utilizzato in un ambiente di produzione per visualizzare informazioni storiche. The server side code as well as the implementation of of showHistoryDialog() is not provided as it is irrelevant to the context. Il codice lato server, nonché l'attuazione di showHistoryDialog di () non è previsto in quanto non è pertinente al contesto.

With libraries like ExtJS and services like GMail, browser is now truly the king. Con le biblioteche come ExtJS e servizi come Gmail, il browser, ora è davvero il re. You don’t need desktop applications for most purposes. Non hai bisogno di applicazioni desktop per la maggior parte degli scopi.