<style> #add{ padding: 8px; } #add table{ width:100%; border-collapse: collapse; border-color: #D4D4D4; border:0px; } #add table tr{ height: 30px; line-height: 30px; } #add table th{ text-align: center; color: #777; width:100px; } #add table td{ padding: 4px 10px; } .isshow{ position: relative; top:-6px; outline: none; } .show{ position: relative; top:1px; } .textbox{ height: 20px; line-height: 20px; padding: 2px; outline: none; } .textbox-addon { position: absolute; top: 2px; } #submit{ margin-left: 30px; } input[name=display]{ position: relative; top: 4px; } </style> <script> $(function(){ /* 提交数据 */ $("#submit").click(function(){ $.ajax({ url:ThinkPHP['MODULE']+'/Category/edit', type:'post', data:{ cid:$("input[name='cid']").val(), pid:$('.textbox-value').val(), cname:$("#cname").val(), dw:$("#dw").val(), display:$("input[name='display']:checked").val(), sort:$("#sort").val(), }, success:function(data){ if(data>0) { $('#tabs').tabs('close', '修改分类');//关闭当前tabs $('#category').treegrid('reload');//刷新分类数据表格 $.messager.show({ title: '我的消息', msg: '修改成功!', timeout: 1000, showType: 'slide' }); }else{ $('#tabs').tabs('close', '修改分类');//关闭当前tabs $('#category').treegrid('reload');//刷新分类数据表格 $.messager.show({ title: '我的消息', msg: '修改失败!', timeout: 1000, showType: 'slide' }); } } }); }); /* 提交数据结束 */ }); </script> <form id="add" data-options="iconCls:'icon-building_add'"> <input type="hidden" name="cid" value="{$datas.cid}" /> <table border="1"> <tr> <th>所属分类</th> <td> <select id="cc" class="easyui-combotree" style="width:180px;" data-options="url:'__MODULE__/Category/getCombotree',required:true,value:'{$datas.pid}'"></select> </td> </tr> <tr> <th>分类名称</th> <td> <input type="text" name="cname" id="cname" class="textbox reset" value="{$datas.cname}"> </td> </tr> <tr> <th>单位</th> <td> <input type="text" name="dw" id="dw" class="textbox reset" value="{$datas.dw}"> </td> </tr> <tr> <th>是否显示</th> <td> <label for="xs" >显示</label><input id="xs" type="radio" name="display" value="1" <if condition="$datas['display'] eq 1">checked</if> > <label for="yc" >隐藏</label><input id="yc" type="radio" name="display" value="0" <if condition="$datas['display'] eq 0">checked</if> > </td> </tr> <tr> <th>排序</th> <td> <input type="text" name="sort" id="sort" class="textbox reset" value="{$datas.sort}" /> </td> </tr> <tr> <td colspan="2"> <a id="submit" data-options="iconCls:'icon-accept'" href="javascript:void(0);" class="easyui-linkbutton">修改分类</a> </td> </tr> </table> </form>