We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

htmlAttribute raises error in _setAttributes

Thread ID:

Created:

Updated:

Platform:

Replies:

118158 Feb 5,2015 06:57 PM Feb 10,2015 01:37 AM JavaScript 6
loading
Tags: ejTreeView
RL
Asked On February 5, 2015 06:57 PM


I'm trying to create a treeview as result of a json request, but the treeview fails to set the HtmlAttributes.

Assuming that:

data= [{Id:"G_3",PId:"",Name:"test",HasChild:true,IsExpanded:false,IsGroup:true,Order:0,ImageUrl:"/content/img/folder.png",ElementId:3,HtmlAttributes:null},{Id:"L_2",PId:"G_3",Name:"test1",HasChild:false,IsExpanded:false,IsGroup:false,Order:0,ImageUrl:"",ElementId:2,HtmlAttributes:{"data-elementid":"2"}},{Id:"L_3",PId:"G_3",Name:"test3",HasChild:false,IsExpanded:false,IsGroup:false,Order:0,ImageUrl:"",ElementId:3,HtmlAttributes:{"data-elementid":"3"}}]
       

$.post(mViewPage.baseUrl + '/treeview/mapview/' + cod).done(function (data) {
            $("#mtreeview").ejTreeView({
                showCheckbox: true,
                fields: {
                    id: "Id", parentId: "PId", text: "Name", hasChild: "HasChild", dataSource: data, imageUrl: "imageUrl",htmlAttribute: "HtmlAttributes"
                }
            });
});

I've traced the problem to the following code in ej.treeview.js, when the _setAttributes is called, the element.attr is undefined

_setAttributes: function(data, element) {
            for (var key in data) {
                element.attr(key, data[key]); //element.attr is undefined
            }
        },


  
Is this some sort of bug or am I missing something?

Thanks





RL
Replied On February 5, 2015 07:18 PM

I've changed the code in ej.treeview.js to be:
_setAttributes: function (data, element) {
            for (var key in data) {
                $(element).attr(key, data[key]);
            }
        },

and now it works. I still fill something is off here.

Saranya Sivakumar [Syncfusion]
Replied On February 6, 2015 06:28 AM

Hi Rui,

Thanks for using Syncfusion products.

We would like to let you know that, “Treeview fails to set the HtmlAttributes” is a known issue and it has been fixed in our latest service pack release (12.4.0.30). We would like you to upgrade to latest version and it can be downloaded from the following link:

http://www.syncfusion.com/forums/118097/essential-studio-2014-volume-4-service-pack-release-v12-4-0-30-available-for-download

For your convenience we have prepared the sample, please download the sample from the following location.

Sample Location: Sample

Please let us know if you have further concern.

Regards,

Saranya.S



RL
Replied On February 6, 2015 07:51 AM

Thanks, I see that only the .min.js are included, is it possible to get the non minified version of the js files?
I'm having a lot of issues with the controls and would be very helpful if I could see the not minified sources.

Saranya Sivakumar [Syncfusion]
Replied On February 9, 2015 08:01 AM

Hi Rui,

As per our support guidelines; through forums widely we offer only limited and basic assistance. 

Since you have requested for non-minified version of the JS files, it is beyond our support limit consigned for a forum.

A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,

Saranya.S



RL
Replied On February 9, 2015 02:43 PM

I understand. Thank you. I've closed the ticket, the initial problem has been fixed.

Saranya Sivakumar [Syncfusion]
Replied On February 10, 2015 01:37 AM

Hi Rui,
Thanks for your update.
Please let us know if you have further concern.
Regards,
Saranya.S



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;