Sending extra data to popup editor

9 posts, 0 answers
  1. Joe
    Joe avatar
    220 posts
    Member since:
    May 2012

    Posted 28 Jul 2017 Link to this post

    I know we can send additional data to the read event, but is there a mechanism for sending additional data to the popup edit screen?
  2. Georgi
    Admin
    Georgi avatar
    700 posts

    Posted 01 Aug 2017 Link to this post

    Hi Joe,

    The edit event is fired when user edits or creates a data item. The property e.container holds the popup window and its possible to modify it.

    The following dojo sample illustrates how to modify the popup window when user edits a data item:



    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Joe
    Joe avatar
    220 posts
    Member since:
    May 2012

    Posted 01 Aug 2017 in reply to Georgi Link to this post

    That's great for modifying the window, but what if I want to pass it an object, or a collection of objects?
  4. Georgi
    Admin
    Georgi avatar
    700 posts

    Posted 03 Aug 2017 Link to this post

    Hello Joe,

    Could you please provide us more detailed information of the scenario and what you are trying to achieve? So I can provide a solution for the exact case.

    The popup can be customized, please refer to the following project which illustrates how to customize the popup edit window:


    The only event that allows you to intercept the popup instantiation is edit.

    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Joe
    Joe avatar
    220 posts
    Member since:
    May 2012

    Posted 03 Aug 2017 in reply to Georgi Link to this post

    I have a grid that has rows in it, and when I click the Edit button, only that rows data is available in the edit popup.  I also want to send some ancillary data to the popup as well that is not part of the record itself.  In the specific case, the edit is for setting a percentage as a fee, and the ancillary data I wish to make available to the edit window is their fee history, for validation.  So if they set a percentage that is already in use, I can disallow the edit, and set the previously used fee as the active fee.
  6. Georgi
    Admin
    Georgi avatar
    700 posts

    Posted 07 Aug 2017 Link to this post

    Hi Joe,

    A possible solution is to request the fees history from the server using jQuery AJAX  when the edit event is fired. This way the ancillary data will by accessible within the popup window.

    In case the additional data is requested with the current page, another solution is to store the data inside a hidden input and retrieve it when edit event is fired using jQuery.

    Since there is no built in functionality for passing additional data to the edit popup window, please give a try to the aforementioned approaches and let me know if they work for you.  


    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Chung On
    Chung On avatar
    2 posts
    Member since:
    Aug 2015

    Posted 09 Aug 2017 Link to this post

    Hi Georgi,

      Can we use the grid edit event fire a Ajax call to get more data from database, store in the model and render in the popup editor for user updating?

    Regards,

      On

  8. Joe
    Joe avatar
    220 posts
    Member since:
    May 2012

    Posted 09 Aug 2017 in reply to Georgi Link to this post

    >> A possible solution is to request the fees history from the server using jQuery AJAX  when the edit event is fired. This way the ancillary data will by accessible within the popup window.

    I'm curious about this...  I can pull the data (it's actually already available in the javascript), but the edit window is bound to the model of the grid.  How do I make this ancillary data available?  How would I actually use it in the popup edit form?  For the record, I do have my own popup edit form I put together for this,it uses the model that is bound to the grid, there's no place to put ancillary data.  So how do I make use of it in the popup?

  9. Georgi
    Admin
    Georgi avatar
    700 posts

    Posted 11 Aug 2017 Link to this post

    Hello,

    Chung, yes it is possible to request more data when edit event is fired and use it in the popup editor. I have assembled small sample which requests data when the edit event is fired and uses the result as dataSource for drop down editor:


    Joe, since the data is already available in the javascript I suggest you to use validation. In other words add a validation rule that checks whether the new value is already contained in the ancillary data:


    You can find more information about validation in the following demo:



    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top