EasyUI 获取行ID,符合条件的添加样式

function GetTableTrID()
    {
        var p = $('#PreFixgrid').prev().find('div table:eq(1)');
        var ID = $(p).find('tbody tr:first').attr('id');
        if (ID != undefined && ID != '' && ID.length > 3) {
            ID = ID.toString().substr(0, ID.toString().length - 1);
        }
        return ID;
    }
function returnGoods()
    {
        var listgrid = $('#listGrids');
        var data = listgrid.datagrid('getData');
        var listrows = $('#PreFixgrid').datagrid('getRows');
        if (data.rows.length>0)
        {
         
            for (var i=0;i<data.rows.length;i++)
            {
              
                if (listrows.length > 0) {

                    for (var j = 0; j < listrows.length; j++) {
                       
                        if (data.rows[i].Serialnumber == listrows[j].serialnumber) {
                            $('#'+GetTableTrID() + j.toString()).addClass('linedelete')
                        }
                    }
                }

            }
        }
    }

  

posted @ 2015-12-30 17:02  放哨De老鼠  阅读(928)  评论(0编辑  收藏  举报