Kendo UI: Render List of Widgets - kendo-ui

I am completely new to using Kendo UI, and would like some help on how to render a array of objects to the screen with each object having it's own data source.
Application Background: A SPA dashboard that will show a list of charts that a user can interact with, moving (drag and drop), deleting, creating new charts.
I have done some digging into the Kendo framework and haven't landed on a solution that seems to work. My original thought was to use a custom defined widget that would use a template to render the charts to the screen and each widget would have it's own data source. However, I couldn't figure out a way to render the widgets.
I tried the MVVM data-bind: source and using a Kendo template to load the widget with the data-role attribute, but that didn't work.
HTML content area
<div data-bind="source: widgetsDataSource" data-template="widget-template-test"></div>
Kendo Template
<script type="text/x-kendo-template" id="widget-template-test">
<div data-role="custom-widget"></div>
</script>
widgetsDataSource: the dataSouce used to retrieve the list of charts to render to the screen
widget-template-test: the template used to initialize and show the custom widget using the data-role attribute
custom-widget: The link to the custom widget I defined in separate JS file.
Question: Does anyone have a resource I may look at or some suggestions on how to tackle this problem? Any help would be greatly appreciated.
Thanks in advance!

I do a lot of work with kendo widgets, my go to resources are the API docs http://docs.telerik.com/kendo-ui/introduction and then if I want to see some demos http://demos.telerik.com/kendo-ui/, I use them with Angular, the demo's are nice because they have Angular specific (as well as MVVM) code, the API docs are handy when you are looking for specific configuration settings.

Related

UI-Router + Kendo UI Grid, weird issue

Ok so lemme explain first for those who are not familiar
Rule number for using Telerik's Kendo UI is to reference the following in this order Jquery.min.js>Angular.min.js>Kendo.all.min.js
Here is the pseudo-code of my web application
in my parent.html:
-reference for jquery
-reference for angular
-reference for kendo
-ui-view container
this is my ui-view(child.html)
-initialize kendo grid
What happened is that the kendo widget was not rendered
Then I looked at the console of the browser and there was something like
"Jquery should be initialized first before angular when using Kendo-UI widgets"
I tried removing the ui-view and and just yolo-pasted the contents of the child.html and the grid widget successfully rendered
But when I use angular-ui-routing, the error appears again saying I should reference jquery first before referencing angular when using kendo widgets
You can only load jQuery once. I had a similar problem where I was calling it once from a shared view and once inside the main view. You have child views? My solution was to push the loading of the Javascript from the shared view to the main view, and also called them inside of the kendo tabStrips, because apparently those were sandboxed enough not to affect the main view. The second loading of jQuery is what's crushing the kendo rendering; figuring out the workaround depends on the relationships between the views.

Orchard CMS Custom Layout using KendoUI

Have anyone tried creating custom layout for Orchard's query/projection functionality? The default layout available when you install Orchard are Grid and List, I'm planning to add custom layout grid using KendoUI (Grid, Listview) while also taking advantage of the Orchards framework, the kendoui grid should be able to display content and non content types. Any idea on where to start? If you can direct me to a sample project implementing this that would be cool...
You can create a new Layout Provider in your theme, which allows you to output the projection data however you wish.
Steve Taylor has a tutorial on writing a custom Layout Provider for creating a carousel using Projections, you could look at his examples to develop your own suiting your needs.

ASP .NET MVC3 Razor Popup View

I am new to web development..
i have created views using Entity Framework in MVC3 Razor..
What i have done yet is,
i 1st created model(Clients) and DbContext(ClientDbContext) Classes.
then, i add controller with scaffolfind options
Template: Controller with read/Write actions and View, Using Entity Framework
Model Class: Clients
Data Context Class : ClientDbContext
Views : Razor(CSHTML)
It Creates the controller class and index, Detail, Delete, Delete Views...
After that i modified the index page for search and pagination...
All are working good...
in the index page i have create, edit, delete, detail links...
When i click the links browser loads to that page and working good...
But i need to popup those views when i click the links in the index page...
i don't know how to do this... i studied many articles but i am confused...
Please help me to solve this with an efficient manner...
Thanks in advance...
Creating a model pop-up within a page isn't something that can be done directly with ASP.NET MVC. You could do it yourself using javascript & css but I would strongly recommend using a JS UI framework to do this. jQuery UI has a pop-up modal box, except they call it a dialog.
The docs for jQuery UI's dialog can be found here. Have a look through the examples to see the fine details of how to set it up. But this is the basic flow of what you need to do:
Download the jQuery UI files needed and include them on your page (CSS/JS files)
Take the html from your create/update/delete views and put it on your index page, wrap them in a div with an appropriate id
When the page loads use jquery ui to target your div's you want to be a popup
Things such as the link you want to make a dialog popup is set by passing options to the dialog initialize method, again the exact options and examples can be found on the docs page.
Refer this : http://jqueryui.com/dialog/ to create a jQuery Dialog box.
<script>
$(function() {
$( "#dialog" ).dialog();
});
</script>
<div id="dialog">
#using(Html.BeginForm()){
#Html.EditorForModel()
<input type='submit' value ='Submit'/>
}
</div>

KendoGrid with in a new custom kendo ui widget

Please guide me how to make a custom kendo ui widget, like if you could refer to some tutorial or anything. Secondly the main question is that I want to use kendo grid to consume webapi and i want to use it in a widget in which and pass the datasource to this widget.
Bascially I want to make a widget which will consume the webapi using a particular url, and which will return a data source that I can add to this kendogrid widget.
Googling a little I just found:
Creating Custom Kendo UI Plugins
Creating a DataSource Aware Kendo UI Widget
Inheriting From Custom Widgets
Creating A Kendo UI MVVM Widget
I think that any and all this blogs should help you (I've written several widget and I found here all I needed).
In addition to #Emiliano's links, the Kendo Music Store demo app also contains a custom Widget bound to a DataSource that you can look at as an example:
Live demo site: http://www.kendouimusicstore.com/
Source code: https://github.com/telerik/kendo-music-store
Custom Widget source: MvcMusicStore/Scripts/App/kendo-cart-menu-widget.js
Documentation for this custom widget: http://docs.kendoui.com/tutorials/ASP.NET/Kendo%20Music%20Store/Music%20Store%20Web/kendo-music-store-web-cart-menu-widget
If you are going to use WebAPI, you will probably want to read this (The Facts On Using Kendo UI With ASP.NET WebAPI) first.
"Use WebApi" is a very broad statement, and narrowing down your approach would be the first step.

iGoogle style dashboard using jquery

Is there any jquery plugin for implementing iGoogle style dashboard? So basically drag n drop style etc.
Thanks
I recently found this:
http://www.webappers.com/2008/11/19/how-to-create-igoogle-interface-with-jquery/
Hope that helps...
Take a look at the jQuery UI portlet demo for Sortable.
If you are looking for a similar dashboard framework, please check out my implementation of igoogle style dashboard called 'sDashboard' : http://modeln.github.com/sDashboard/
This plugin, helps in converting an array of widget definitions into a dashboard, were each object in the array gets rendered as a dashboard widget.
Its has some neat features to render table and charting widgets and is highly configurable. The documentation page includes a link to a demo application & example usages to render different styled widgets.
Check out my implementation of an iGoogle style Dashboard using jQuery.

Resources