Hi ,
I am using m4 for my project . It’s an excellent UI framework . I like it very much .
But I find some bug when I am using list view as a table . The method add can’t work correctly . I debug into the code , find that :
if (Utils.objectLength(o.structure > 0)) $.each(o.structure, function(key, val){
if (data[key] !== undefined) {
$("<div>").addClass("node-data item-data-"+key).addClass(data[val]).html(data[key]).appendTo(node);
}
});
The if case is incorrect , I think it should be if (Utils.objectLength(o.structure) > 0)
And the case body seems do nothing for the node , I change the code ,now it works for me ,
if (Utils.objectLength(o.structure) > 0) $.each(o.structure, function(key, val){
if (data[key] !== undefined) {
var sub = $("<div>").addClass("node-data item-data-"+key).addClass(data[val]).html(data[key]).appendTo(node);
node.append(sub);
}
});
The Library I am using is Metro 4 Components Library v4.2.8
===================================================================================================
sorry , sorry ,
The code i modified has some problem , i changed it as below:
if (Utils.objectLength(o.structure) > 0) $.each(o.structure, function(key, val){
if (data[key] !== undefined) {
$("<div>").addClass("node-data item-data-"+key).addClass(val ? '' : 'd-none').html(data[key]).appendTo(node);
}
});
m4 bug for listview
m4 bug for listview
Last edited by chengjie on Mon Jul 16, 2018 4:14 am, edited 1 time in total.
Thank u , olton , i downloaded the new version 4.2.14 , the bug is still there .