Modify ajax url after editor object has been initialized

Modify ajax url after editor object has been initialized

Oliver.TeOliver.Te Posts: 1Questions: 1Answers: 0

Dear all,

we have a DT and DT Editor in place. The content of the DT is dynamically updated subject to a selection made in a dropdown box (price list number - itpl_id). We use myTable.ajax.url(ajax_url + "&itpl_id=" + itpl_id).load(); for that.

Unfortunately there seems to be no documented api method in order to do the same with the DT editor ajax url. This means when we update a line for a pricelist id (itpl_id) other than the one we have created the myEditor object, it will disappear until we reselect a new itpl_id from the dropdown menu in order to update myTable.

Is there any (hidden) method we can use in order to modify the DT Editor ajax url? Thanks for your help in advance!

Kind regards,
Oliver

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Hi Oliver,

    You are correct - at the moment there isn't an API in Editor to change the Ajax url (something I'll add in a future release - thanks for mentioning it!). However, since its only the data that you want to change, you could use ajax.data as a function to determine what value should be submitted to the server.

    It would be in the POST body using this method rather than they query string, but hopefully that shouldn't cause any issues (unless you have some cunning routing going on with your urls!).

    Allan

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Hi Allan,
    Is this part of the latest release? Do let me know.

    Thanks,
    Harsha

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Yep, you can use ajax() to replace the original Ajax configuration.

    Colin

This discussion has been closed.