datagrid checkbox

 

onBeforeCellEdit: function(index,field){
    var row = $(this).datagrid('getRow', index);
    console.log(row)
}

https://www.jeasyui.com/forum/index.php?topic=5868.0



$(function(){

$('#dg').datagrid({

onLoadSuccess: function(){

$(this).datagrid('getPanel').find('.tooltip-dlg').each(function(){

$(this).tooltip({

content: $('<div></div>'),

onUpdate: function(content){

content.panel({

width: 500,

height: 200,

border: true,

http://code.reloado.com/ayibuk3/9/edit#javascript,html

https://www.jeasyui.com/forum/index.php?topic=7104.0

 function formatAttribute(value,row,index){

return '<span class="tooltip-dlg" data-field="'+this.field+'" data-index="'+index+'">'+value+'</span>';

}

$(function(){

$('#dg').datagrid({

onLoadSuccess: function(){

$(this).datagrid('getPanel').find('.tooltip-dlg').each(function(){

$(this).tooltip({

content: $('<div></div>'),

onUpdate: function(content){

content.panel({

width: 500,

height: 200,

border: true,

title: 'Tooltip Dialog'

});

var index = $(this).attr('data-index'); // get the row index

                                                        var field = $(this).attr('data-field');

var dg = $('<table></table>').appendTo(content);

                          //var data = service.getData(indexColumn, indexRow); //get new data with column and row indexes

dg.datagrid({

fit: true,

border: false,

                                data: data,

columns: [[

{field:'date',title:'Date',width:'45%'},

{field:'value',title:'Value',width:'55%'}

]]

});

},

onShow: function(){

var t = $(this);

t.tooltip('tip').find('.datagrid-f').datagrid('resize');

t.tooltip('tip').unbind().bind('mouseenter', function(){

t.tooltip('show');

}).bind('mouseleave', function(){

t.tooltip('hide');

});

}

})

})

}

})

})

</script>

</head>

<body>

<table id="dg" title="Basic DataGrid" style="width:700px;height:250px"

data-options="singleSelect:true,collapsible:true,data:data">

<thead>

<tr>

<th data-options="field:'productid',width:100">Product</th>

<th data-options="field:'01.01.2010',align:'right',formatter:formatAttribute">01.01.2010</th>

<th data-options="field:'02.01.2010',formatter:formatAttribute">02.01.2010</th>

<th data-options="field:'03.01.2010',align:'center',formatter:formatAttribute">03.01.2010</th>

</tr>

</thead>

</table>


</body>

</html>

留言

這個網誌中的熱門文章

考績被打差了 輕率離職會更傷

Arrays - DS (Reverse array) [Easy]

WireMock