Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: use Ext Js EditorGridPanel in Perl

by Proclus (Beadle)
on Sep 20, 2010 at 14:58 UTC ( [id://860855]=note: print w/replies, xml ) Need Help??


in reply to use Ext Js EditorGridPanel in Perl

I also use a template based approach in my web projects. In addition, I use a JSON based messaging system.
Perl returns the data in JSON format, and you can process the returned javascript data structure to feed the EditorGridPanel.

This mechanism works with AJAX as well as normal page loads. For the latter, I fill the JSON output inside a <script> tag (which is fethed as part of an html template); when the html is sent to the browser, the json data structure can be processed by the relevant JS methods in your onLoad() method.

For templating solutions, you can have a look at HTML::Template, Clearsilver, Template::Toolkit in CPAN.
For json: JSON::XS or JSON::PP.

Replies are listed 'Best First'.
Re^2: use Ext Js EditorGridPanel in Perl
by Anonymous Monk on Sep 23, 2010 at 09:35 UTC
    Thanks.... Please can you give me example. And one thing how do get the params from Java script Eg. This is my JS code and i want the base params
    id: 'PresidentsDataStore', proxy: new Ext.data.HttpProxy({ url: '/cgi-bin/extjstest/order_module_data.cgi', method: 'POST' }), baseParams:{task: "LISTING"}, // this parameter is passed for any +HTTP request reader: new Ext.data.JsonReader({ root: 'results', totalProperty: 'total', id: 'id' },[ {name: 'IDpresident', type: 'int', mapping: 'IDpresident'}, {name: 'FirstName', type: 'string', mapping: 'firstname'}, {name: 'LastName', type: 'string', mapping: 'lastname'}, {name: 'IDparty', type: 'int', mapping: 'IDparty'}, {name: 'PartyName', type: 'string', mapping: 'name'}, {name: 'TookOffice', type: 'date', mapping: 'tookoffice'}, {name: 'LeftOffice', type: 'date', mapping: 'leftoffice'}, {name: 'Income', type: 'float', mapping: 'income'} ]),
      your_object.baseparams

      But seriously, if you're struggling to put the pieces together, Using Perl, jQuery, and JSON for Web development is an example of a complete app. It doesn't use that particular javascript, but it does manipulate a database.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://860855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (None)
    As of 2024-04-25 01:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found