{"issue":{"created_at":"2011-11-29T19:33:56Z","state":"open","updated_at":"2011-11-29T19:33:58Z","user":{"gravatar_id":"73122aef4d0e965206fd6faddaa3340e","id":481937,"url":"https://api.github.com/users/Toflar","login":"Toflar","avatar_url":"https://secure.gravatar.com/avatar/73122aef4d0e965206fd6faddaa3340e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":2,"body":"Hi Leo\n\nRight now I'm developing a widget that allows the user to edit a foreign DCA.\nIn fact it is going to be part of Isotope and the example why this is needed is the following:\nRight now every product has its price - one price only.\nNow I have a customer that needs different prices for the same product, depending on things like the usergroup or special prices during Christmas or whatever.\n\nSo I thought the easiest way for the user would be a widget within tl_iso_products where he or she can edit the table tl_iso_prices via Ajax.\nObviously I could call my php methods using the existing \"executePostActions\" hook and copy the parts of DC_Table I need.\n\nInstead of copying all this code I thought it's easier if I just call the normal edit mode (e.g. main.php?do=dcaWizard&table=tl_iso_prices&act=edit&id=1) and inject what I need in my widget which works like a charm.\n\nNow I get to the problem. When submitting the form with the same action (so still main.php?do=dcaWizard&table=tl_iso_prices&act=edit&id=1) the data is stored correctly in the database BUT I get forwarded, because you reload the page after saving to prevent POST data from being sent twice, which is perfectly correct.\nBut my ajax call doesn't get any result because of the hard reload and I'd like to parse the response for <p class=\"error\">'s so the validation doesn't get lost.\n\nIn fact I just need you to change line 1741 in DC_Table (rev 525) from the following code:\n\n```\nif ($this->Input->post('FORM_SUBMIT') == $this->strTable && \n\n![]($this->noReload)\n```\n\ninto this:\n\n```\nif ($this->Input->post('FORM_SUBMIT') == $this->strTable && )$this->noReload && !$this->Input->get('isAjax'))\n```\n\nThis way I can request the data like this: main.php?do=dcaWizard&table=tl_iso_prices&act=edit&id=1&isAjax=1\nI don't get forwarded and get the data I need.\n\nA very small change and tested :-)\n\nThanks for reading and implementing ;-)\nYanick\n\n--- _Originally created on August 14th, 2010, at 04:38pm (ID 2436)_","assignee":null,"id":2391033,"number":2436,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"backend","color":"e6e6e6","url":"https://api.github.com/repos/contao/import/labels/backend"},{"name":"Feature","color":"4183c4","url":"https://api.github.com/repos/contao/import/labels/Feature"}],"title":"Allow Ajax call of DC_Table","closed_at":null,"html_url":"https://github.com/contao/import/issues/2436","url":"https://api.github.com/repos/contao/import/issues/2436","milestone":null},"action":"opened"}