Migrating from Telerik to Kendo - change event

5 posts, 0 answers
  1. Gary Davis
    Gary Davis avatar
    71 posts
    Member since:
    Oct 2003

    Posted 17 Apr 2013 Link to this post

    I am migrating from Telerik NumericTextBox to Kendo and have a question about the change event.

    The page has multiple NumericTextBoxes in the grid rows so the change event needs the ID of the control to know which grid row is being changed.

    The commented lines were from the Telerik version

    function SpinnerQtyChange(e) {
        var target = this.element[0];
        var id = target.id.replace("QtySpinner_", "");
        var quantityJ = $(target).closest("td"); // Up to my <td> (Quantity)
        QtyChange(id, quantityJ, this.value(), e.oldValue);

        //var id = e.target.id.replace("QtySpinner_", "");
        //var quantityJ = $(e.target).parent().parent(); // Up to my <td> (Quantity)
        //QtyChange(id, quantityJ, e.newValue, e.oldValue);
    }

    The problem is the e.oldValue - where can I find it?

    Thanks,
    Gary Davis
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 18 Apr 2013 Link to this post

    Hello Gary,


    The oldValue property is no longer supported. Could you provide some additional information about the current scenario, so I could suggest you a suitable way to overcome the issue.

    I am looking forward to hearing from you.

     

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Gary Davis
    Gary Davis avatar
    71 posts
    Member since:
    Oct 2003

    Posted 18 Apr 2013 Link to this post

    If there is no more oldValue, I will have to come up with a new technique. The current technique checks the difference in quantity and adjusts the item price and the footer subtotal and total by that amount. This is a shopping cart checkout page (see it live at http://www.blowitoutahere.com - pre-kendo version - stick on ?debugjs=on to see uncompressed scripts).

    A solution will be to iterate thru all items to recalculate and update the subtotals and totals.

    Is there a way to modify the cart grid data instead of modifying the table cell contents and then tell the grid to re-generate using the changed data? This is a server-side Telerik grid, not Kendo (yet) and but scollable so all the data is available (there can be 100's of items in the cart).

    Thanks.
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 22 Apr 2013 Link to this post

    Hi Gary,


    A possible workaround in a server bounded grid would be to add a hidden input in the template, which will hold the old value and could be retrieved in the change event of the NumericTextBox. In an Ajax bounded Kendo Grid, you could use the dataItem method, which will return the model for the current row (the old value would still be in the model).

    Regarding your second question, this could not be achieved in a server bounded Grid. 

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Gary Davis
    Gary Davis avatar
    71 posts
    Member since:
    Oct 2003

    Posted 23 Apr 2013 Link to this post

    Thanks for your help, Dimiter.

    Instead of adding hidden fields, I am able to calculate the old value by simply dividing the extended price by the unit price, both of which are already in the grid.

    Gary
Back to Top
Kendo UI is VS 2017 Ready