Author Topic: Grid scroll then modify data reset  (Read 1576 times)

SHIN WOOCHUL

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 13
    • View Profile
Grid scroll then modify data reset
« on: September 05, 2019, 01:44:35 pm »
I set column
render  : function(){
 return "<input type = 'text'  />"
}
and i insert string then i using grid scroll and it disappear table then I see again it , it return nothing
but if I using scroll bar it return origin value

Why It reset? and can I prevent this?

and also how to I get Data in javascript
Code: [Select]
    var colM = [
                { title: "<msg:message code="label.checkBox"/>",/* width : '10%', */ dataIndx: "paymentNo",align:"center",editable : false
                ,render : function(ui){
                var qrcodeData = ui.rowData.qrcode;
                var rowIndx = ui.rowIndx;
                var paymentNo = ui.rowData.paymentNo;
                if(qrcodeData == '' || qrcodeData == null){   
            var inHtml="<div><input type='checkbox'  class=\"checkPrintYN\"  name = \"deliveryItemList["+rowIndx+"].printYN\" value=\"Y\" />";
            inHtml+="<input type='hidden' name = \"deliveryItemList["+rowIndx+"].paymentNo\" value=\""+paymentNo+"\"/></div>";
                return inHtml;
                }else{
                return '';
                }
                }
                },
                { title: "<msg:message code="label.payNo"/>",/* width : '10%', */ dataIndx: "paymentNo" ,editable : false},
                { title: "<msg:message code="label.confirmDt"/>",/* width : '15%',*/dataIndx: "confirmDt",editable : false },
                { title: "<msg:message code="label.confirmQnty"/>",/*  width : '10%', */format: '##,###',
                    dataType: "integer", dataIndx: "confirmQnty",editable : false
                },
                { title: "<msg:message code="label.paymentDt"/>",/* width : '15%', */dataIndx: "paymentDt" ,editable : false },
                { title: "<msg:message code="label.paymentAmount"/>",/* width : '10%', */format: '##,###',
                    dataType: "integer", dataIndx: "paymentAmount",editable : false
                },
                { title: "<msg:message code="label.processStatus"/>",/* width : '10%', */  dataIndx: "processStatus",editable  : false },
                { title: "<msg:message code="label.orderNo"/>",/* width : '10%',*/ dataIndx: "orderNo",editable  : false },
                { title: "<msg:message code="label.orderDt"/>",/* width : '20%', */ dataIndx: "orderDt",editable  : false },
                { title: "<msg:message code="label.receivingNo"/>",/* width : '20%', */ dataIndx: "arrivalNo" ,editable  : false},
                { title: "<msg:message code="label.deliveryDt"/>",/* width : '20%', */ dataIndx: "deliveryDt" ,editable  : false},
                { title: "<msg:message code="label.receivingDt"/>",/* width : '20%', */ dataIndx: "inDt" ,editable  : false},
                { title: "<msg:message code="label.partNo"/>",/* width : '10%',*/ dataIndx: "itemCd" ,editable  : false},
                { title: "<msg:message code="label.partNm"/>",/* width : '20%', */ dataIndx: "itemNm" ,editable  : false},
                { title: "<msg:message code="label.unt"/>",/* width : '5%', */ dataIndx: "orderUnit" ,editable  : false},
                { title: "<msg:message code="label.subcontract"/>",/* width : '5%', */ dataIndx: "smTypeNm" ,editable  : false},
                { title: "<msg:message code="label.orderQnty"/>",/* width : '10%', */  format: '##,###.00',
                    dataType: "float", dataIndx: "orderQnty",editable  : false
                },
                { title: "<msg:message code="label.boxperQnty"/>",/* width : '10%', */  format: '##,###.00',
                    dataType: "float", dataIndx: "boxQnty",editable  : false
                },
                { title: "<msg:message code="label.lotNo"/>",/* width : '5%', */ dataIndx: "lotNo" ,editable  : false},
                { title: "<msg:message code="label.deliveryQnty"/>",/* width : '10%', */  format: '##,###.00',
                    dataType: "float", dataIndx: "deliveryQnty",editable  : false
                },
                { title: "<msg:message code="label.inQnty"/>",/* width : '10%',  */ format: '##,###.00',
                    dataType: "float", dataIndx: "inQnty",editable  : false
                },
                { title: "<msg:message code="label.RMregQnty"/>",/* width : '10%', */  format: '##,###.00',
                    dataType: "float", dataIndx: "rmQnty",editable  : false
                },
                { title: "<msg:message code="label.ngAmount"/>",/* width : '10%', */  format: '##,###.00',
                    dataType: "float", dataIndx: "ngAmount",editable  : false
                },
                { title: "<msg:message code="btn.print"/>",/* width : '5%', */ dataIndx: "qrcode",editable  : false,
                render : function(ui){
                var qrcodeData = ui.rowData.qrcode;
                if(qrcodeData != '' && qrcodeData != null){
                var inHtml="<div><a class=\"btn btn-xs blue\" style = \"height: 20px;padding-top: 2px;\" href=\"#\" onclick=\'fprint(\""+qrcodeData+"\")\'>";
        inHtml+="Print</a></div>";
                return inHtml;
                }
                }
                }          

    ];
 
    var obj = {
    width : '100%',
    height : 450,
    colModel: colM,
    title : '<i class="fa fa-cogs"></i><msg:message code="box.itemList"/>',
    loadonce : true,
        hwrap: true,
        wrap: true,
        mergeCells : mc,
        dataModel : {data:list},
        flex: { one: true },
    };
   
    $("#grid01").pqGrid(obj);
« Last Edit: September 05, 2019, 02:49:01 pm by SHIN WOOCHUL »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Grid scroll then modify data reset
« Reply #1 on: September 05, 2019, 03:30:37 pm »
grid uses virtual rendering, so any value in input text box added in render callback would be lost with scrolling of grid.

Please use editors for editing of data.