前端表单帮助文档

 

1.单选框

 @Html.RadiosFor("Sex", "09:30-10:30", new string[] { "1", "2", "3" }, new string[] { "男", "", "未定" })     

获取选中值

  //radio改变时候获取到值
$('input[type=radio][name=TimeBetween]').change(function () { var val =$("input[name='TimeBetween']:checked").val(); });

 2.复选框

   @Html.ChecksFor("ckLable", Model.Lable, new string[] { "客厅", "餐厅", "卧室"}, new string[] { "客厅", "餐厅", "卧室"})

获取选中的值逗号隔开

        var ids = new Array();
            //获取所有选中的值,将其用逗号隔开
            $('input[name="ckLable"]:checked').each(function (index, value) {
                ids.push($(this).val());
            })
            $("#Lable").val(ids.join(','));

 3.日期格式

<input id="BeginTime" name="BeginTime" value="" type="text" class="Wdate" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss', isShowToday: true, isShowClear: false,lang:'zh-cn' })" />

 4.DataGri行内状态样式

<span class='label label-success'>成功</span>
<span class='label label-error'>失败</span>
<span class='label label-info'>信息</span>
<span class='label label-warning'>警告</span>

5.DataGrid操作按钮样式

{
                    field: 'Oper', title: '@Resource.操作', width: 80, sortable: false, align: 'center', formatter: function (value, row, index) {
                        return "<a class='fa fa-plus btn-icon-success' title='Create' onclick='Create(\"" + row.Id + "\");'></a>" +
                            "<a class='fa fa-pencil btn-icon-warning' title='Edit' onclick='Edit(\"" + row.Id  + "\");'></a>" +
                            "<a class='fa fa-trash btn-icon-danger' title='Delete' onclick='Delete(\"" + row.Id  + "\");'></a>";
                   }
},

6.Tips提示信息框

<div class="showtip" id="showtip">
    <div>
        Tips:这是一条信息帮助的提示
    </div>
</div>

7.超链接

<div><a href="#" class="a-org a-unline">橘红色</a></div>
<div><a href="#" class="a-blue a-unline">蓝色</a></div>
<div><a href="#" class="a-red a-unline">红色</a></div>
<div><a href="#" class="a-black a-unline">黑色</a></div>
<div><a href="#" class="a-org a-unline">橘红色带下划线</a></div>
<div><a href="#" class="a-blue a-unline">蓝色带下划线</a></div>
<div><a href="#" class="a-red a-unline">红色带下划线</a></div>
<div><a href="#" class="a-black a-unline">黑色带下划线</a></div>

 

注:后面会继续补充

8:EasyUI treegrid和tree点击行或文字展开 

//  treegrid
 onSelect: function (row) {
                (row.state == "closed") ? $(this).treegrid('expand', row.Id) :         $(this).treegrid('collapse', row.Id);
            },
//tree
onSelect:function(node){
    $(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
}        
  onClickCell: function (field, row) { //在用户点击一个单元格的时候触发。
      if (field == "Name") {  //指定点了Name一列才展开
         (row.state == "closed") ? $(this).treegrid('expand', row.Id) : $(this).treegrid('collapse', row.Id);
      }
  },

9.EasyUI treegrid 加载全部

   onLoadSuccess: function (data) {
                $('#List').treegrid("expandAll");
            },

 

10.让DataGrid特定行的CheckBox不可用(多选的列表)

    onLoadSuccess: function (data) {
            $("#List").datagrid("clearSelections");
            var rows = data.rows;
            for (var k = 0; k < rows.length; k++) {
                if (rows[k].Status == 1) // ==1的数据 他的ck不能被选
                {
                    $("#ListDiv tr[datagrid-row-index='" + k + "'] td").eq(0).html('');
                }
            }
          
        },

    <div  id="ListDiv">
        <div id="List"></div>
    </div>

 

  

 

posted @ 2020-05-10 19:44  ymnets  阅读(787)  评论(0编辑  收藏  举报