jQuery UI Widgets Forums Grid Grid-Validation message

This topic contains 3 replies, has 3 voices, and was last updated by  jadhavsagar.jadhav@gmail.com 4 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Grid-Validation message #48495

    Keshavan
    Participant

    Hi,

    I have used ‘cellvaluechanging’ event for validation as in code (in BOLD) below.
    I am using ‘alert’ for showing message, instead please let me know how to use ‘message’ popup as used
    in validation function.

    Thanks,

    Keshavan

    $("#productGrid").jqxGrid
                                        ({
                                            width: 960,
                                            height: 350,
                                            source: dataAdapter,
                                            theme: 'ui-sunny',
                                            pageable: true,
                                            sortable: true,
                                            filterable: true,
                                            columnsresize: true,
                                            autoshowfiltericon: true,
                                            enabletooltips: true,
                                            editable: true,
                                            selectionmode: 'singlerow',
                                            columns:
                                            [
                                                { text: 'OrderDetailId', datafield: 'OrderDetailId', hidden: false, width: 80 },
                                                { text: 'OrderId', datafield: 'OrderId', hidden: false, width: 80 },
                                                { text: 'Code', datafield: 'ProductCode', editable: false, width: 130 },
                                                { text: 'Description', datafield: 'ProductDesc', editable: false, width: 360 },
                                                { text: 'Available Qty', datafield: 'StockQty', editable: false, width: 80 },
                                                {
                                                    text: 'Order Qty', datafield: 'Quantity', editable: true, width: 80,
                                                   <strong> cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {
                                                        StockQty = $('#productGrid').jqxGrid('getcellvalue', row, "StockQty")
                                                        if (newvalue > StockQty+oldvalue) {
                                                            alert("Qty can't be > Available Quantity, original value is reset!!");
                                                            return oldvalue;
                                                        }
                                                        else
                                                            $('#productGrid').jqxGrid('setcellvalue', row, "StockQty", StockQty - (newvalue - oldvalue));
                                                            var price = $('#productGrid').jqxGrid('getcellvalue', row, "SellPrice")
                                                            $('#productGrid').jqxGrid('setcellvalue', row, "ItemValue", newvalue*price);
                                                            Tqty += (newvalue - oldvalue);
                                                            Tamt += ((newvalue * price) - (oldvalue * price));
                                                            $('#log2').html('Order Qty: ' + Tqty);
                                                            $('#log1').html('Order Val: ' + Tamt);
                                                            return newvalue;
                                                    }
                                                },</strong>
                                                { text: 'Price', datafield: 'SellPrice', editable: false, width: 80 },
                                                { text: 'Item Value', datafield: 'ItemValue', editable: false, width: 130 }
                                            ]
                                        })
                                },
    Grid-Validation message #48496

    Peter Stoev
    Keymaster

    Hi Keshavan,

    Simply use the “validation” callback function as shown in our Editing demo – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/cellediting.htm?arctic. There you can define the returned message, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid-Validation message #48500

    Keshavan
    Participant

    Hi Peter,

    One small question, will i be able to get ‘oldvalue’ in validation callback ?

    Thanks,

    Keshavan

    Grid-Validation message #113424

    Dear Team,

    We have found one issue in the jqxtreegrid validation. I have two condition in validation function and different message for each condition. When first condition fails, error message appears which is fine. Now immediately when second condition executes seconds error message appears with overlapping on first message. In that case I see two error message with overlapping with each other. We would be very helpful if you provide solution for the same.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.