Telerik Forums
Kendo UI for jQuery Forum
3 answers
185 views
Assuming your data only has two levels of depth, in which case would you favor an array of (objects containing a) DataSource versus a HierarchicalDataSource and vice versa?

In such a case, we are tempted to use option 1 because the DataSource is much better documented and easy to grasp than the HierarchicalDataSource but the HierachicalDataSource might have hidden benefits worth the learning curve.
Alexander Valchev
Telerik team
 answered on 26 Jun 2013
3 answers
4.6K+ views
I have a combo box set up to cascade to another combo box. This works.  I have mapped both a change event and a select event in the "parent" - - both of which also work. I am planning to observer the state of the "parent"  knockout via the knockout-kendo plugin.  I expect this to work.

BUT - I need to be able to trigger the cascade programmatically, as well.  That is, I need to programmatically change the selected index of the "parent".  To test this in advance of mapping it in knockout,  I have a test button that successfully changes the selected item in the "parent".  So, this works.

Here is problem: neither the change event nor a select event are triggered in response to the following (which is in the test button click handler):
var cbx = $("select").data("kendoComboBox")
cbx.select(2);
That is, the combo box changes state but kendo is not triggering either of  the events.

I have tried this in various fiddles (modifying a similar situation) and it does not work there either.

This is quite important to us, so please let me know if this is not supported.

Thanks

S



Alexander Valchev
Telerik team
 answered on 26 Jun 2013
1 answer
103 views
I'm trying to figure out how to change the height of a basic sparkline. I've tried the following:

01.$("#hum-log").kendoSparkline({
02.                type: "area",
03.                data: [
04.                    71, 70, 69, 68, 65, 60, 55, 55, 50, 52,
05.                    73, 72, 72, 71, 68, 63, 57, 58, 53, 55,
06.                    63, 59, 61, 64, 58, 53, 48, 48, 45, 45,
07.                    63, 64, 63, 67, 58, 56, 53, 59, 51, 54
08.                ],
09.                height: 50,
10.                tooltip: {
11.                    format: "{0} %"
12.                }
13.            });
But it did not seem to make a difference.
Iliana Dyankova
Telerik team
 answered on 26 Jun 2013
3 answers
575 views
Hello,i am a computer science student ,working for a small software company and totally newbie about KendoUI.
I have a MVC project  that connects to database ,get and shows data's on KendoUI grid.I would like to  use combobox on my custom editor template with KendoUI grid pop up.

There is Kendo combobox on Index page.It fetchs and shows records from db  with selected column().
I am using  Kendo grid -  pop up  as a  interface.There are add,edit, and update buttons.When i click add or edit button  pop up screen opens which is related to my custom template.Every command is working well(add,edit,delete)

The problem is when i add Kendo combobox to my custom editor template , it  shows nothing on grid.Edit and delete buttons are missing and when i click to add button it shows this ajax code.It looks like some problem about rendering.
{"Data":[],"Total":4,"AggregateResults":null,"Errors":null}

Here is my Kendo combobox code:
@(Html.Kendo().ComboBox()
  .Name("productComboBox") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget.
  .DataTextField("ALLERGYTYPE") //Specifies which property of the Product to be used by the combobox as a text.
  .DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value.
// .Filter(FilterType.Contains)
 .Placeholder("ALLERGYTYPE")
  
 .DataSource(source =>
 {
    source.Read(read =>
    {
        read.Action("GetProducts", "AllergiesData"); //Set the Action and Controller name
    })
    .ServerFiltering(true); //If true the DataSource will not filter the data on the client.
 })

Getting data controller for combobox -
public JsonResult GetProducts()
{
    PHRDevEntities patient = new PHRDevEntities();
 
 
    return Json(patient.PR_PATIENTALLERGY, JsonRequestBehavior.AllowGet);
 
 
}

Another controller to get,create ,update etc.
public ActionResult Get([DataSourceRequest]DataSourceRequest request)
       {
           return Json(DataAccess.Get(request), JsonRequestBehavior.AllowGet);
       }
 
 
       public ActionResult CreateSingle([DataSourceRequest]DataSourceRequest request, TEntity itemNew)
       {
           return Json(DataAccess.Create(request, itemNew.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }
 
public ActionResult Create([DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<TEntity> itemsNew)
       {
           return Json(DataAccess.Create(request, itemsNew, true, ModelState));
       }
 
       public ActionResult UpdateSingle([DataSourceRequest]DataSourceRequest request, TEntity itemUpdated)
       {
           return Json(DataAccess.Update(request, itemUpdated.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }
 
 
       public ActionResult DestroySingle([DataSourceRequest]DataSourceRequest request, TEntity itemToDelete)
       {
           return Json(DataAccess.Destroy(request, itemToDelete.ToArrayFromObject(), false, ModelState), JsonRequestBehavior.AllowGet);
       }

My custom editor template:
@model KendoUIMvcApplication1.DATA.PR_PATIENTALLERGY
       <strong>PR_PATIENTALLERGY</strong> <br />
 
        <table width="100%" cellspacing="5" style="margin:20px">
                                <tr>
                                    <td width="10%">@Html.LabelFor(model => model.PATIENTID)</td>
                                    <td width="40%">@Html.EditorFor(model => model.PATIENTID)
                                                    @Html.ValidationMessageFor(model => model.PATIENTID)</td>
 
                                    <td width="10%">@Html.LabelFor(model => model.DOCTOR)</td>
                                    <td width="40%" >@(Html.Kendo().ComboBox()
    .Name("productComboBox") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget.
    .DataTextField("ALLERGYTYPE") //Specifies which property of the Product to be used by the combobox as a text.
    .DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value.
   // .Filter(FilterType.Contains)
    .Placeholder("ALLERGYTYPE")
     
    .DataSource(source =>
    {
       source.Read(read =>
       {
           read.Action("GetProducts", "AllergiesData"); //Set the Action and Controller name
       })
       .ServerFiltering(true); //If true the DataSource will not filter the data on the client.
    })
    //.SelectedIndex(0) //Select first item.
     
)
                             @Html.ValidationMessageFor(model => model.DOCTOR)</td>
 
                                </tr>
                     <tr>
                                 <td width="10%">@Html.LabelFor(model => model.ISACTIVE)</td>
                                    <td width="40%" >@Html.EditorFor(model => model.ISACTIVE)
                                                                @Html.ValidationMessageFor(model => model.ISACTIVE)</td>
                  </tr>
                            </table>
I have also DataAccess methods to control data.I can post them if it is needed.
He is the almost same problem with me:  stackoverflow
Vladimir Iliev
Telerik team
 answered on 26 Jun 2013
1 answer
77 views
Hi there I have a line chart with grouped data and narrowRange: true set.

When one of my datapoints has a null value it seems that narrow range is ignored.  Folks are choosing series from a dropdown and when one series has a null the scale changes suddenly which isn't ideal.

Here is a fiddle with all datapoints for each line  and narrowRange working well-  http://jsfiddle.net/jriley17/vDdmt/
and here is one with a null value for one of the points -  http://jsfiddle.net/jriley17/j83Sk/

thanks!
Iliana Dyankova
Telerik team
 answered on 26 Jun 2013
1 answer
104 views
I have following code and I am getting e.dataItem as undefined. Is there a way to get access to dataItem and its properties at client using JavaScript?

Html.Kendo().Grid<AdminReport>()   
.Name("AdminReportList")
.Columns(c =>        
{
c.Bound(r => r.Name).Title("Report Name").Width(50);                    
c.Bound(r => r.Id).Title(action).Width(230).Sortable(false).Filterable(false)
})
.Pageable(p => p.PreviousNext(true))
.Sortable()
.Filterable()   
.Events(e => e.DataBound("onRowBound"))   
.DataSource(d => d       
.Ajax()       
.Model(m => m.Id(r => r.Id))       
.Read(read => read.Action("_ListAllReports", "AdminReports"))       
.Events(e => e.Error("OnError")))
.Render();
function onRowBound(e) {
    
  if ((e.dataItem.SomeProperty === true)) {
       //Some code...
    }
 
}
Dimiter Madjarov
Telerik team
 answered on 26 Jun 2013
1 answer
96 views
Is there way to show spinner for chart while used datasource fetches data from server (ajax call)?

Thanks!

Kiril Nikolov
Telerik team
 answered on 26 Jun 2013
2 answers
118 views
I want the Stacked bars have no border, how can I config?
wei
Top achievements
Rank 1
 answered on 26 Jun 2013
7 answers
316 views
Reading http://docs.kendoui.com/getting-started/framework/spa/view I understand that the "render" method renders a view inside a container by replacing the current content with the new content.

However, when testing, I did not see that behaviour. Actually on "render" the view is appended to the current content, inside the wrapping "div" element.

Michael G. Schneider
mgs
Top achievements
Rank 1
 answered on 26 Jun 2013
1 answer
106 views
Our page contains complex "Widgets" and each widget might have multiple views, and we're using MVVM for the data.

I'm wondering (and I've seen posts eluding to this) if I can scrap the url routing portion and just be able to define views for each widget?...I'm concerned with the routes in the url and multiple widgets all getting confused and\or creating a terrible url.  Really nobody would be going "back", bookmarking, or linking anyway.

If this is possible, is there a demo\sample anywhere?

Steve
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 25 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?