or
app.controller('gridController', ['$scope', function ($scope ) {//Initilization code$scope.gridOptions = { //Setup options};$scope.detailOptions = function (e) { console.log('winning'); return { dataSource: { transport: { read: { url: "/detail" + e.OrderNumber + ".json", dataType: 'json' } }, error: function (e) { console.log(e); }, pageSize: true, serverPaging: false, serverFiltering: false, serverSorting: false, }, columns: [ { field: "ItemCode", label: "lblItemCode", title: "" }, { field: "ItemDesc", label: "lblItemDesc", title: "" }, { field: "QuantityOrdered", label: "lblQuantityOrdered", title: "" } ], scrollable: false, sortable: true };}app.directive('grid', function () {return { // Restrict E for element restrict: 'E', // Here we setup the template for the code we want to replace our directive template: "<div> \n\ <div kendo-grid='grid' \n\ k-options='gridOptions'\n\ k-data-source='dataSource'>\n\ </div> \n\ <script type='text/x-kendo-template'\n\ id='details'>\n\ <div kendo-grid >\n\ </div>\n\ </script>\n\ </div>", replace: true, scope: { }, controller: "gridController", link: function (scope, element, attrs) { //Gather some attribute data and set it to the gridOptions object if(scope.$eval(attrs.detailsGrid)) { scope.gridOptions.detailTemplate = kendo.template($("#details").html()); scope.gridOptions.detailInit = scope.detailOptions; } //More customization code scope.dataSource = new kendo.data.DataSource({ //Setup dataSource options for main grid }); }};});<ul> <li><a data-role="button" data-rel="modalview" href="#modalview-loanamount" id="modalview-open-button">Help</a></li></ul><style scoped> #modalview-open-button { width:5em; }</style>$(window).resize(function () { // for any chart or gauge widget $(".k-chart").each(function () { // get the instance of the chart/gauage var chart = kendo.widgetInstance($(this), kendo.ui); var c = $(this).data("kendoChart"); // make sure transitions are off //chart.options.transitions = false; console.log($(window).height() * 0.4); c.height($(window).height() * 0.4); // redraw the chart/gauge if (chart && chart.redraw) { chart.redraw(); } }); }); <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><br> <script type="text/javascript" src="/js/vendor/kendo-ui/kendo.all.min.js"></script><br><br> <div class="k-content"><br> <textarea id="KEditor" rows="10" cols="30" placeholder="@GetText("Content")" maxlength="255" style="height: 500px"></textarea> <br> </div>$(document).ready(function() {<br> $("#KEditor").kendoEditor({<br> tools: [<br> "fontName",<br> "fontSize",<br> "foreColor",<br> "backColor",<br> "bold",<br> "italic",<br> "underline",<br> "justifyLeft",<br> "justifyCenter",<br> "justifyRight",<br> "justifyFull",<br> "insertUnorderedList",<br> "insertOrderedList",<br> "indent",<br> "outdent",<br> "createLink",<br> "unlink",<br> "insertImage",<br> "viewHtml"<br> ],<br> imageBrowser: {<br> transport: {<br> read: {<br> type: "GET",<br> url: "/api/sites/user-gallery",<br> },<br> destroy: "/api/sites/user-gallery?action=delete",<br> thumbnailUrl: function(path, name) {<br> var pictureUrl = decodeURIComponent(name);<br> return pictureUrl;<br> },<br> uploadUrl: "/api/sites/user-gallery?action=upload", //work if this line is commented<br> imageUrl: function(name) {<br> var pictureUrl = decodeURIComponent(name);<br> return pictureUrl;<br> },<br> }<br> } <br> //, messages: { viewHtml: '@GetText("ViewHtml")'}<br> });<br> }); {"pictureId":1369437,"name":"http://s3.amazonaws.com/nocnokdemo-img/1404301211033c10e4f43bdb468ba132ef12048d2438.jpg","type":"f","size":1024,"url":"http://s3.amazonaws.com/nocnokdemo-img/1404301211033c10e4f43bdb468ba132ef12048d2438.jpg"}