Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - virendraparade01

Pages: [1]
1
Hello,
I want to remove the required validation of the cell, depends on another cell value.

Any help would be appreciated.

Thanks.

2
Bug Report / Paramquery ToolTip sort not Working
« on: September 09, 2019, 01:16:51 pm »
Hey hello,
 I just tried to add the tooltip at header '<span title = "Item">Item</span>' using this way but here why cant I sort the column. because when I just keep the title : Item  sorting works fine.

for reference plz do check the file:
https://jsfiddle.net/virendraparade01/2ymqsoka/

3
ParamQuery Pro Evaluation Support / Validation Issues
« on: August 21, 2019, 11:14:07 am »
Hey

Here in My project I have "ItemNo", "Qunatity", "TargetPrice", "Description", "PackingInstructions" defined by default. Now the new user is going to fill the required fields "ConfirmedQuantity", "ConfirmedPrice" and "LineTotal". But

1. when I try to Submit the Grid it directly throws an error, I don't know why even all the cells are field properly it throws an error.
2. No error or required symbol is displayed for the required cells even though I submit a empty grid.

can u plz let me know what's the issue here.

Issue Link:
https://jsfiddle.net/virendraparade01/uagx8tw0/

4
ParamQuery Pro Evaluation Support / Re: column calculation
« on: August 16, 2019, 08:58:37 pm »
  {
                title: "UNIT OF MEASURE", width: 100, dataType: "string", dataIndx: "UnitOfMeasure",
                render: function (ui) {
                    var abc = ui.rowData.ItemNo
                    var Unit = GetUnit(abc)                                                       //calling the GetUnit Function
                    return ui.cellData = Unit;
                }
               
             
            },

using the above solution I can see the value of ui.celldata on screen...but whenever I try to

  var gridChanges = grid.getChanges({ format: 'byVal' });
 console.log(gridChanges);

UnitOfMeasure: undefined

Here why can't I get the value of cell Unitofmeasure...could u plz help me out

5
ParamQuery Pro Evaluation Support / Re: column calculation
« on: August 13, 2019, 10:26:57 am »
can I Hide the button of attachments in row of Total

6
ParamQuery Pro Evaluation Support / column calculation
« on: August 12, 2019, 07:32:34 pm »
Hello Paramveer,
can u plz let me know what is the issue here in the code related to the column "Confirmed Quantity" calculation where I just fill the quantity for specific item. but can get the total at bottom of column.

 The row is generated at the bottom can changes don't get reflected

Jsfiddle Link: https://jsfiddle.net/virendraparade01/3a1zqvkt/2/.


7
Hy Hello,
   Please go through the link shared below of jsfiddle where I have uploaded my code.
 
Note:In code there is commented code,  please go through the case1, case2, case3 where I have explained issues in each case.
currently, the working code is of case 1 issue.

Link: https://jsfiddle.net/virendraparade01/h1ugy5ra/4/
Thanks.

8
As u have recommended about the batch editing, but here if the user closes the tab without saving the data and return back to the same page he should be able to view the data whatever he had added previously. so here as the rows are filled one by one we were the thinking them to add to the session so even though after a while he returns back to the page he could be able to see whatever he has entered. and the second point is our client is going to add thousands of records, so the same we are thinking to store in a session, so in such case would it be reliable to store the data in session.

9
Issues 1:

Hey I was working with autocomplete, so here in the Item Number table when I Select one item so the column for Description and Unitofmeasure get data mapped on the basis on ItemNo but when I try to copy multiple excel rows and paste them in the grid only the first row data is mapped for Description and unit of measure and other remains blank could u plz help me out here.

Please also go through attachment for proper understanding
Image1: Selection of item number using auto-complete method.
Image2: Dap-mapped in Description and Unit of Measure column on selecting the Item number.
Image3: When the multiple rows are pasted from excel to grid Description and unit of Measure column data is not mapped.


Note: custom Implementation for LocalStorage

code:


    $(function () {
        var interval;
        var count = 0;
        var ItemNoDetails = null;
        var ItemDescription;


        var autoCompleteEditor = function (ui) {
            var $inp = ui.$cell.find("input");
            $inp.autocomplete({
                appendTo: ui.$cell,
                source: (ui.dataIndx == "list", "/RFQEntry/GetItemNO"),
                selectItem: { on: true },
                highlightText: { on: true },
                minLength: 0
            }).focus(function () {
                $(this).autocomplete("search", "");

            });
        }
        function saveChanges() {

            if (!$.active && !grid.getEditCell().$cell && grid.isDirty() && grid.isValidChange({ allowInvalid: true }).valid && count == 0) {
                count++;

                var gridChanges = grid.getChanges({ format: 'byVal' });
                return gridChanges;

            }
        }




        var obj = {
            dragColumns: { enabled: false },
            hwrap: false,
            resizable: true,
            rowBorders: false,
            autoRow: false,
            rowHt: 32,
            trackModel: { on: true }, //to turn on the track changes.
            toolbar: {
                items: [{
                    type: 'button',
                    icon: 'ui-icon-plus',
                    label: 'New Product',
                    listener: function () {
                        //append empty row at the end.
                        var rowData = {}; //empty row
                        var rowIndx = grid.addRow({ rowData: rowData });
                        grid.goToPage({ rowIndx: rowIndx });
                        grid.editFirstCellInRow({ rowIndx: rowIndx });
                        $("#grid_editing").focus();
                        count = 0;
                    }
                },
                { type: 'separator' },

                {
                    type: "<span class='saving'>Saving...</span>"
                }
                ]
            },
            scrollModel: { autoFit: true },
            editor: { select: true },


            colModel: [
                {
                    title: "ITEM", dataIndx: "ItemNo", width: 120, editor: { type: "textbox", init: autoCompleteEditor, },
                    validations: [
                        { type: 'minLen', value: 1, msg: "Required" },
                        {
                            type: function (ui) {
                                var value = ui.value,
                                    _found = false;
                                $.ajax({
                                    url: "/RFQEntry/CheckItem",
                                    data: { 'ItemNo': value },
                                    async: false,

                                    success: function (response) {
                                        if (response == "true") {
                                            _found = true;
                                            ItemNoDetails = value;
                                           
                                        }
                                    }
                                });
                                if (!_found) {
                                    ui.msg = value + " not found in list";
                                    return false;
                                }
                            }
                        }
                    ]
                },
                {
                    title: "QUANTITY", width: 100, dataType: "integer", dataIndx: "Quanitity",
                    validations: [
                        { type: 'nonEmpty', msg: "Required" },

                    ]
                },
                {
                    title: "UNIT OF MEASURE", width: 100, dataType: "string", dataIndx: "UnitOfMeasure",
                    validations: [
                        { type: 'nonEmpty', msg: "Required" },

                    ]
                },
                {
                    title: "TARGET PRICE", width: 100, dataType: "float", dataIndx: "TargetPrice",
                    validations: [{ type: 'gte', value: 0, msg: "Required" }]
                },

                {
                    title: "DESCRIPTION", width: 100, dataType: "string", align: "center", dataIndx: "Description",
                    validations: [{ type: 'gte', value: 0, msg: "Required" }]
                },

                {
                    title: "NOTES", width: 100, dataType: "string", dataIndx: "Notes",
                    render: function (ui) {
                        return "<button type='button' class='Note_btn'>Add Note</button>";
                    },
                    render: function (ui) {
                        return "<button type='button' class='Note_btn'>Add Note</button>";
                    },

                    postRender: function (ui) {

                        var grid = this,
                            $cell = grid.getCell(ui);
                        $cell.find(".Note_btn")
                            .button()
                            .bind("click", function (evt) {

                                $("#popup-dialog-crud").dialog({

                                });
                                $("#popup-dialog-crud").dialog("open");
                                $("#a").click(function () {
                                    console.log("data added")
                                });

                                $("#c").click(function () {
                                    $("#popup-dialog-crud").dialog("close");
                                });
                            });

                    }
                },


                { title: "PACKING INSTRUCTIONS", width: 100, dataType: "string", dataIndx: "PackingInstructions" },

                {
                    title: "Attachments", width: 100, dataType: "string", dataIndx: "Attachments",
                    render: function (ui) {
                        return "<button type='button' class='Attach_btn'>Add Attachment</button>";
                    },

                    postRender: function (ui) {

                        var grid = this,
                            $cell = grid.getCell(ui);
                        $cell.find(".Attach_btn")
                            .button()
                            .bind("click", function (evt) {

                                $("#Attachments").dialog({

                                });
                                $("#Attachments").dialog("open");
                                $("#aa").click(function () {
                                    console.log("attachments added")
                                });

                                $("#ac").click(function () {
                                    $("#Attachments").dialog("close");
                                });
                            });

                    }
                },


                {
                    title: "", editable: false, minWidth: 85, sortable: false,
                    render: function (ui) {
                        return "<button type='button' class='delete_btn'>Delete</button>";
                    },
                    postRender: function (ui) {
                        var grid = this,
                            $cell = grid.getCell(ui);
                        $cell.find(".delete_btn")
                            .button({ icons: { primary: 'ui-icon-scissors' } })
                            .bind("click", function (evt) {
                                grid.deleteRow({ rowIndx: ui.rowIndx });
                            });
                    }
                }
            ],


            formulas: [
                ["UnitOfMeasure", function () {
                    var id = ItemNoDetails;
                    var Unitresult = "";
                    localStorage.removeItem("Unitresult");
                    localStorage.removeItem("ItemDescription");
                    if (id != null) {
                        $.ajax({
                            url: "/RFQEntry/GetItemDescription",
                            data: { 'ItemNo': id },
                            async: false,
                            success: function (response) {
                                var ConvertJsonResponse = JSON.parse(response);
                                Unitresult = ConvertJsonResponse.UnitOfMeasure;
                                ItemDescription = ConvertJsonResponse.Description;
                                localStorage.setItem("ItemDescription", ItemDescription);
                                localStorage.setItem("Unitresult", Unitresult);
                            }
                        });
                    }
                    ItemNoDetails = null;
                    return localStorage.getItem("Unitresult");
                }
                ],

                ["Description", function () {

                    return localStorage.getItem("ItemDescription");

                }],

            ],


            postRenderInterval: -1, //synchronous post render.
            pageModel: { type: "local", rPP: 20 },
        };
        var grid = pq.grid("#grid_editing", obj);
    });
==============================================================================================
Issue2

AutoSave Functionality

As we are going to the use session to store the temporary data of grid row one by one using auto-save functionality and at the end clicking on submit button all the data should be saved to the database from the session so here which would be the best approach.



Pages: [1]