m4 bug for listview

General issues related to the use of Metro 4
Post Reply
chengjie
Posts: 2
Joined: Fri Jul 13, 2018 12:46 pm
Status: Offline

m4 bug for listview

Post by chengjie » Fri Jul 13, 2018 12:50 pm

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);
}
});
Last edited by chengjie on Mon Jul 16, 2018 4:14 am, edited 1 time in total.

User avatar
olton
Site Admin
Posts: 133
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Fri Jul 13, 2018 1:25 pm

Hi, where its code in the source file? And The latest version is 4.2.14. Maybe you need to update?

chengjie
Posts: 2
Joined: Fri Jul 13, 2018 12:46 pm
Status: Offline

Post by chengjie » Mon Jul 16, 2018 4:21 am

Thank u , olton , i downloaded the new version 4.2.14 , the bug is still there .

User avatar
olton
Site Admin
Posts: 133
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Mon Jul 16, 2018 10:11 am

where its code in the Metro 4 source javascript file?

Post Reply