Hi Support Team,
I had a big issue when using KendoListView function on windows 8 platform. The issue is window 8 platform doesn't allow us add dynamic html that contain unsafe code.
I made a search and found out this link:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx
This is extracting from the article:
"Dynamically adding HTMLA page
in your app's local context has more access to the system than other Web pages (or "Web-context pages") do. It can access the Windows Runtime and, depending on the app's permissions, might be able to access the file system and your devices. For this reason, it's important to prevent potentially malicious code from executing.To guard against script injections and help shield your system from potentially malicious code, HTML you inject into a page in the local context is filtered as though it was processed by the toStaticHTML method. Injecting HTML that contains an unknown element, event handler, script or reference to script, or unknown CSS pseudo-element and pseudo-class causes an exception when you try to add the HTML to the page's DOM."
We can work around by placing the block of code in the function MSApp.execUnsafeLocalFunction as following:
MSApp.execUnsafeLocalFunction(function () {
var listView = $("#listView").kendoListView({
dataSource: localDataSource,
selectable: 'single',
template: kendo.template($("#CountryListView_template").html())
});
});
But this method is not good as we must change code of the whole process to make it work. So I need to override the kendoListView function to make it affect for the whole project without much code changes.
I tried this one:
_kendoListView = $.fn.kendoListView;
$.fn.kendoListView = function (i) {
var _this = this;
MSApp.execUnsafeLocalFunction(function () {
_kendoListView.apply(_this, arguments);
});
}
But it doesn't work. Would you please help me how to override this function above. i just want to add the code MSApp.execUnsafeLocalFunction before call KendoListView function.
Thanks and Best Regards,
Craig,
I had a big issue when using KendoListView function on windows 8 platform. The issue is window 8 platform doesn't allow us add dynamic html that contain unsafe code.
I made a search and found out this link:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx
This is extracting from the article:
"Dynamically adding HTMLA page
in your app's local context has more access to the system than other Web pages (or "Web-context pages") do. It can access the Windows Runtime and, depending on the app's permissions, might be able to access the file system and your devices. For this reason, it's important to prevent potentially malicious code from executing.To guard against script injections and help shield your system from potentially malicious code, HTML you inject into a page in the local context is filtered as though it was processed by the toStaticHTML method. Injecting HTML that contains an unknown element, event handler, script or reference to script, or unknown CSS pseudo-element and pseudo-class causes an exception when you try to add the HTML to the page's DOM."
We can work around by placing the block of code in the function MSApp.execUnsafeLocalFunction as following:
MSApp.execUnsafeLocalFunction(function () {
var listView = $("#listView").kendoListView({
dataSource: localDataSource,
selectable: 'single',
template: kendo.template($("#CountryListView_template").html())
});
});
But this method is not good as we must change code of the whole process to make it work. So I need to override the kendoListView function to make it affect for the whole project without much code changes.
I tried this one:
_kendoListView = $.fn.kendoListView;
$.fn.kendoListView = function (i) {
var _this = this;
MSApp.execUnsafeLocalFunction(function () {
_kendoListView.apply(_this, arguments);
});
}
But it doesn't work. Would you please help me how to override this function above. i just want to add the code MSApp.execUnsafeLocalFunction before call KendoListView function.
Thanks and Best Regards,
Craig,