We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Using AJAX in the CP (EE 2.0)

Development and Programming

Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

I’m trying to implement a jeditable textfield in the CP of my module (mcp.module.php).

Here’s the code from the view:

$(document).ready(function() {
     $('.editable').editable('http://ee2pb.dev/system/index.php?S=ab72a19d08e6af47dc78cecb14f8c2af23c6c766&D=cp&C=addons_modules&M=show_module_cp&module=mymodule&method=save_method',
         {
             indicator : 'Saving...',
            tooltip   : 'Click to edit...',
            cancel    : 'Cancel',
            submit    : 'OK',
                      
            callback : function(value, settings) {
                 /*console.log〈this〉;
                 console.log〈value〉;
                  console.log〈settings〉;
                   */
                  alert(value);                  
             }

If I just do a /save.php in the above code, it will work (contact /save.php on my webserver).

However, the above code will fist call the module, EE will respond with headers “302 Moved Temporarily”), and AJAX will end up calling the main page of the CP.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.