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 - Davjov

Pages: [1]
1
Hello,
when I edit data in a row, it is saved and passed on to the next application. But when I add or remove rows, they are not saved and displayed in the next application. What do I have to change with the following functions to make this possible?


   function addRow() {
   
                var $frm = $("form#crud-form");
                $frm.find("input").val("");
   
                $("#popup-dialog-crud").dialog({ title: "Eintrag Hinzufügen", buttons: {
                    Add: function () {
                        var row = [];
                        //save the record in DM.data.
                        row[0] = $frm.find("input[name='kategorie']").val();
                        row[1] = $frm.find("input[name='komponente']").val();
                        row[22] = $frm.find("input[name='summary']").val();
                       
                        $grid.pqGrid('addRow', { rowData: row });
                       
                        $(this).dialog("close");
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
               
                }
                });
                $("#popup-dialog-crud").dialog("open");
            }


And:

 function deleteRow() {
                var rowIndx = getRowIndx();
                if (rowIndx != null) {
                    $grid.pqGrid("deleteRow", { rowIndx: rowIndx });
                    $grid.pqGrid("setSelection", { rowIndx: rowIndx });
                }
            }
            function getRowIndx() {
                var arr = $grid.pqGrid("selection", { type: 'row', method: 'getSelection' });
                if (arr && arr.length > 0) {
                    return arr[0].rowIndx;                               
                }
                else {
                    alert("Wählen sie eine Reihe aus");
                    return null;
                }}


Thank for your help.

Pages: [1]