ligerui grid编辑怎么使他点击就可以编辑

2020-07-12 科技 96阅读
ligerui grid行编辑示例,具备新增行、删除行功能,可在修改某个cell之后,如果录入错误,可以提醒用户。
?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171    <%@____simple_html_dom__voku__am p____nbsp><% >html>     ZTREE DEMO - Simple Data                var contextpath = "<%>";            .myul li{float:left;width:100px;display:inline;}         /frameworks/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />     /frameworks/jquery/jquery-1.4.4.min.js" type="text/javascript">       /frameworks/ligerUI/js/core/base.js" type="text/javascript">           /frameworks/ligerUI/js/plugins/ligerDialog.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerGrid.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript">    /frameworks/ligerUI/js/plugins/ligerResizable.js" type="text/javascript">    /js/json2.js" type="text/javascript">        /js/uuid.js" type="text/javascript">              var manager, g;        $(document).ready(function(){            $("#leafOpt").click(function(){                $("#urlDom").show();            });            $("#dirOpt").click(function(){                $("#urlDom").hide();            });            //初始化grid            function itemclick(item)            {                alert(item.text);            }            var typeData = [{ val: 'url', text: 'URL' }, { val: 'btn', text: '按钮'}, { val: 'code', text: '分级编码'}];            var rowData = { Rows: []};            g =  manager = $("#maingrid").ligerGrid({                columns: [                { display: '名称', name: 'name', align: 'left', width: 120,editor: { type: 'text' } } ,                { display: '类型', width: 60, name: 'type',                    editor: { type: 'select', data: typeData, valueColumnName: 'val' },                    render: function (item)                    {                        for (var i = 0; i < > 30) return false;            }            return true;        }        //编辑后事件         function onAfterEdit(e)        {            //当切换类型时,自动填充名称前缀            //alert(JSON.stringify(e.record));            //alert("after, e.column: "+JSON.stringify(e.column));            if(e.column.name=="type") {                var data = manager.getData();                var d = data[e.rowindex];                var name = '';                if(d.type=="url")                    name="url";                else if(d.type=="code")                    name="code_";                else if(d.type=="btn")                    name="btn_";                g.updateCell('name', name, e.record);             }            //当名称修改后,校验前缀是否与类型匹配            if (e.column.name == "name")            {                var d = e.record;                var cellObj = g.getCellObj(d, e.column);                //var name = d[e.column.name];                var name = $(cellObj).text();                if(name.length                                         目录节点                叶子节点                                                                                                                                                
    
    新增行    删除行    
    
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com