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.

Load partial view using treeview

Thread ID:

Created:

Updated:

Platform:

Replies:

119282 Jun 1,2015 08:00 AM Jun 2,2015 11:40 PM JavaScript 1
loading
Tags: ejTreeView
Gomtesh
Asked On June 1, 2015 08:00 AM

I have to to following functionality using angularjs

controller code...

<div ng-controller="SidebarController">
    <a id="treeView" ej-treeview e-fields-datasource="dataList" e-fields-id="id" e-fields-parentid="pid" e-fields-text="name" e-datasource="localdata" e-fields-haschild="hasChild" e-fields-expanded="expanded" e-fields-imageurl="imageUrl" e-nodeselect="selected" />
    <div   ng-include="viewurl"/>

</div>



i want t oload partial view at ng-include


view code....


var UrlData = [{ id: 2, pid: 1, url: '../view/fictionbooks/FictionBook1.html' },
               { id: 3, pid: 1, url: "../view/fictionbooks/FictionBook2.html" },
.................
...............
...];


    $scope.dataList = ListViewData;

  $scope.selected = function (args) {

        for (var i = 0; i < UrlData.length; i += 1) {
            var jsonobject = UrlData[i];
            if (jsonobject.id == args.id) {
                $scope.viewurl = jsonobject.url;
                //$scope.show = true;
                CommonService.Url = UrlData.url;
            }
        }

    }






Sasikala Nagarajan [Syncfusion]
Replied On June 2, 2015 11:40 PM

Hi Gomtesh,

Thanks for using Sycnfusion products,

We have analyzed your requirement and prepared the sample based on your requirement. Please get the sample from below location

Sample

To set the scope variable as src to ng-inlcude, please refer the below code snippet

[html]

<ng-include src="viewPage"></ng-include>



To bind the updated scope variable value, we have to call $scope.$apply() method for binding. Please refer the below code snippet

Angular controller:


$scope.loadpage = function (args) {

for (var i = 0; i < UrlData.length; i += 1) {


var jsonobject = UrlData[i];


if (jsonobject.id == args.id) {


$scope.viewPage = jsonobject.url;


}

$scope.$apply();

}

};


Please check with the given sample and let us know if you have further queries,

Regards,

Sasikala Nagarajan


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.

;