EasyUI Forum

General Category => Bug Report => Topic started by: Don_Juan on October 18, 2017, 06:04:38 AM



Title: The colspan-mergeCells propertygrid is Bugged?
Post by: Don_Juan on October 18, 2017, 06:04:38 AM
Hi,
using colspan to join columns in a propertygrid, I noticed that, it works until I select a line; Once selected and exited from the selected cell, colspan no longer works.

Code:
//count = Number of row
//colSpan = How many column merge

function merge(count, colSpan=3){
    $('#detailsView').propertygrid('mergeCells', {
        index:   count,
        field:   'value',
        colspan: colSpan
    });
}
The effect into attachement (Before.jpg and After.jpg)

I use Jquery-easyui-1.5.3-patch

Do you know how to help me?


Title: Re: The colspan-mergeCells propertygrid is Bugged?
Post by: jarry on October 18, 2017, 07:06:44 PM
You should merge cells after finish the editing action.
Code:
function mergeCells(){
$(this).propertygrid('mergeCells', {
index: 1,
field: 'value',
rowspan: 2
})
}
$('#pg').propertygrid({
onLoadSuccess: mergeCells,
onAfterEdit: mergeCells
});


Title: Re: The colspan-mergeCells propertygrid is Bugged?
Post by: Don_Juan on October 20, 2017, 02:09:29 AM
OK thanks
How do I apply only to certain values?
When do I need to call it that way?

Code:
function mergeCells(rowIndex){
    $(this).propertygrid('mergeCells', {
        index: rowIndex,
        field: 'value',
        rowspan: 3
    })
}
$.each(valuesToMerge, function(rowIndex,value) {
    $('#pg').propertygrid({
        onLoadSuccess: mergeCells(rowIndex),
        onAfterEdit: mergeCells(rowIndex)
    });
});

Or how should I do it?
Thanks.