`
shilianjun
  • 浏览: 33750 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

jquery easyui

    博客分类:
  • js
阅读更多
0.API(1.2.4)
http://www.cnblogs.com/Philoo/archive/2011/11/17/jeasyui_api_index.html

1.
jQuery EasyUI 窗口(Window)用法
http://www.ityizhan.com/jquery-easyui-window-usage/

2.
jQueryEasyUI Messager基本使用
http://www.cnblogs.com/libingql/archive/2011/07/17/2109020.html

3.
DataGrid点击行不自动选中checkbox
onLoadSuccess: function(){
        function bindRowsEvent(){
                var panel = $('#upgrade_grid').datagrid('getPanel');
                var rows = panel.find('tr[datagrid-row-index]');
                rows.unbind('click').bind('click',function(e){
                        return false;
                });
                rows.find('div.datagrid-cell-check input[type=checkbox]').unbind().bind('click', function(e){
                        var index = $(this).parent().parent().parent().attr('datagrid-row-index');
                        if ($(this).attr('checked')){
                                $('#upgrade_grid').datagrid('selectRow', index);
                        } else {
                                $('#upgrade_grid').datagrid('unselectRow', index);
                        }
                        e.stopPropagation();
                        });
                }
                setTimeout(function(){
                        bindRowsEvent();
                }, 10);
}

---------------------------------------
        onLoadSuccess : function(rows){
                $("#customerInfo").datagrid('clearSelections');
        }


4.扩展easyui datagrid的两个方法.动态添加和删除toolbar(JS文件见附件)
http://easyui.btboys.com/post-80.html
用法:
引入脚本文件。
    $('#tt').datagrid("addToolbarItem",[{"text":"xxx"},"-",{"text":"xxxsss","iconCls":"icon-ok"}])//添加
    $('#tt').datagrid("removeToolbarItem","GetChanges")//根据btn的text删除
    $('#tt').datagrid("removeToolbarItem",0)//根据下标删除

示例:
    $.ajax({
        url: "xxx.action",
        type: "POST",
        dataType: "json",
        async:true,
        success:function (data) {
            $('#tt').datagrid("addToolbarItem",data);
        },
        error:function (data) {

        }
    });

5.对话框显示汉字
$.messager.defaults={ok:"确定",cancel:"取消"};
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics