Telerik Forums
Kendo UI for jQuery Forum
4 answers
634 views

Hi,

I am trying to display images in a tree using the HierarchicalDataSource.

My binding is currently defined as follows:

data = new kendo.data.HierarchicalDataSource({
    transport: {
        read: {
            url: "/Controller/Action",
            dataType: "json"
        }
    },
    schema: {
        model: {
            id: "Id",
            hasChildren: "HasChildren"
        }
    }
});
 
$("#tree").kendoTreeView({ 
    dataSource: data,
    dataTextField: "Alias"
});


In my controller action I return a list of a class that contains an ImageUrl.
If i try and bind to the image in the following way, the source value of the rendered image tag equals "ImageUrl" and not the value defined in the object I am binding to.

schema: {
        model: {
            id: "Id",
            hasChildren: "HasChildren",
            imageUrl "ImageUrl"
        }
    }


For example:

<img class="k-image" alt="" src="ImageUrl"/>


However, I would expect that the src should equal whatever I have defined in the ImageUrl in the json object that I return, for example "Image.gif".

I have also tried using the sprite css class, however, I can not change the class either, it always takes the name that I have defined in the schema model.
I need to change the Image displayed for a tree node, depending on what I return during remote binding.

Can anybody assist me further? Or give me a few tips so I understand what is happening?

Alex Gyoshev
Telerik team
 answered on 11 Mar 2013
1 answer
55 views
I have a farely simple question -  can the navigator exist by itself with no other chart ?
Iliana Dyankova
Telerik team
 answered on 11 Mar 2013
1 answer
50 views
Hi all, im new in Kendo and i want render just the 
navigator  :
navigator: {
                               series: {
                                   type: "area",
                                   field: "Close"
                               },
                               select: {
                                   from: "2009/02/05",
                                   to: "2011/10/07"
                               }
, for make a select date range.

ItÅ› possible?
Thanks
Iliana Dyankova
Telerik team
 answered on 11 Mar 2013
3 answers
225 views
Title says it all. I'd like to accomplish what's being done on this page:
http://demos.kendoui.com/web/grid/editing-custom.html

Specifically:
columns.Bound(p => p.Employee).ClientTemplate("#=Employee.EmployeeName#");

But my column is a ForeignKey column and my child object seems to come back null. Any ideas how I could get this done?

Thank you!
Michael
Vladimir Iliev
Telerik team
 answered on 11 Mar 2013
2 answers
114 views
Hi,

I am having a simple form where i am showing a grid from a datasource.After I need to show the same in a window.
It is working fine but, after closing the window upon showing the data if i want to reload the data again then I am getting undefined error for the grid.
For this i have just tried an example with opening a window and after loading the data again for a dropdown box it is also throwing the same error.
Is it the problem with kendoui or have anybody faced this kind oof error.
Any idea??

Regards,
Sri.
Fatih
Top achievements
Rank 1
 answered on 11 Mar 2013
0 answers
25 views
You can reproduce this issue here on the "Batch Editing" demo: http://demos.kendoui.com/web/grid/editing.html

1. Edit any row. Note that the red "dirty cell marker" appears in the upper left corner.
2. Select a different row than the one you edited and Delete it.
3. The dirty cell marker on the first row disappears.

Is there any workaround for this issue?

Thanks!

Andy
Top achievements
Rank 1
 asked on 11 Mar 2013
1 answer
92 views
Can anybody tell me if this JSON is formatted incorrectly the dataSource isn't consuming it to create a chartl Thanks.

JSON:
{"customerSatisfactionChart":[{"KPIColumnName":"Time To Reach Qualified Tech","KPIColumnValue":3.579831},{"KPIColumnName":"Completeness Of Solution","KPIColumnValue":3.359243},{"KPIColumnName":"Opinion Of Overall Service","KPIColumnValue":3.720588},{"KPIColumnName":"Tech Ability And Prod Knowledge","KPIColumnValue":3.636554},{"KPIColumnName":"Time To Provide Solution","KPIColumnValue":3.285714},{"KPIColumnName":"Ease Of Requesting Help","KPIColumnValue":3.758403},{"KPIColumnName":"How Well Are You Kept Informed","KPIColumnValue":3.262605}]}


dataSource setup:

        dataSource: {
            transport: {
                read: {
                    url: '../Test/GetData',
                    dataType: "json"
                }
            }
        },
        schema: {
            data: "customerSatisfactionChart"
        },
        series: [{
            field: "KPITestColumnValue"
        }],
        categoryAxis: {
            field: "KPITestColumnName"
        },
Iliana Dyankova
Telerik team
 answered on 11 Mar 2013
3 answers
129 views
  Hi,

I'm hoping you can help me I am trying to create a chart pulling data from the Entity Framework and passing it as JSON. My JSON output is as below:

a
[
""KPIColumnName":"Time T...ColumnValue":"3.579831""
,
""KPIColumnName":"Comple...ColumnValue":"3.359243""
,
""KPIColumnName":"Opinio...ColumnValue":"3.720588""
, 4 more...]
I have tried to setup my remote data source:

var customerSatisfactionDataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: '../Test/GetData',
            dataType: "json"
        }
    }
});


And then setup my chart to use this data source:

function createkpiBreakdownChart(labelPosition) {
    $("#kpiBreakdownChart").kendoChart({
        theme: $(document).data("kendoSkin") || "metro",
        dataSource: customerSatisfactionDataSource,
        schema: {
            a: "a"
        },
        series: [{
            field: "KPIColumnValue"
        }],
        categoryAxis: {
            field: "KPIColumnName"
        },
        title: {
            text: "Customer Satisfaction"
        },
        legend: {
            position: "bottom",
            visible: false,
        },
        chartArea: {
            background: "#ffffff"
        },
        seriesDefaults: {
            type: "bar"
        },
        //series: [{
        //    name: "Performance Metrics",
        //    data: [4.552162849872774, 4.391752577319588, 4.215633423180593, 4.345108695652174, 4.4728682170542635, 4.387005649717514, 4.351351351351352]
        //},],
        valueAxis: {
            minorUnit: .25,
            majorUnit: 1,
            min: 0,
            max: 5,
            plotBands: [{
                from: 4,
                to: 5,
                color: '#000000',
                opacity: .1
            }],
            labels: {
                labels: {
                    format: "N0"
                },
 
            },
            tooltip: {
                visible: true,
                format: "N0"
            }
        },
        //categoryAxis: {
        //    categories: ['Ease of requesting help', 'Time to reach qualified technician', 'Time to provide a solution', 'Completeness of solution', 'Technical ability & product knowledge', 'How well we kept you informed', 'Overall opinion of service'],
        //},
        tooltip: {
            visible: true,
            format: "#.##"
        }
    });
}


However currently I get nothing rendered on my chart just an empty outline.

If I do a jquery ajax call in firebug like this:

    $.ajax({
        type: 'GET',
        url: '../Test/GetData',
    }).done(function (data) {
        var customerSatisfactionChartData = data;
    }).fail(function (jqXHR, textStatus) {
    })

I get the JSON response from above, so I'm getting the JSON however it's not getting rendered in the chart. My series should be the ColumnValue and my categories the ColumnNames. Can you please help me understand what part I have missed or improperly formatted? Thanks.
Iliana Dyankova
Telerik team
 answered on 11 Mar 2013
6 answers
353 views
The documentation for the Datasource http://docs.kendoui.com/api/framework/datasource  tells about the returned object of the "at" method.
kendo.data.ObservableObject | kendo.data.Model The type depends on the schema.
Would you please explain that a little bit. When ObservableObject? When Model?

In my sample, there is a model and a datasource (transport and several other parts ommited). Some data is read from a remote server.
var model = kendo.data.Model.define({
   id: "ID",
   fields: {
      ID: { type: "number", editable: false },
      Name: { type: "string", validation: { required: true } }
   }
});
 
var datasource = {
   schema: {
      model: model
   }
};
 
var ds = new kendo.data.DataSource(datasource);
ds.fetch(function () {
   var data = ds.at(0);
});
Now, what is given back from the "at" method? Is it an ObservableObject? Does it have a reference to the model?

Looking at "data" when debugging makes me think that it does have a connection to the model, as the "fields" collection is part of the object. However, if "data" is bound to some HTML View, the model seems to be ignored. The "editable" is not regarded on input, the "required" is not regarded on validation.

Michael G. Schneider
mgs
Top achievements
Rank 1
 answered on 11 Mar 2013
4 answers
140 views
http://jsfiddle.net/Zakpu/y8nfK/

Hello,
check out my fiddle.

I have a combobox bound to an external json datasource. It has fields for product names and manufacturers. I get the dropdown values that combine Manufacturer + Product name via a template. The problem is the text field which is set to name. I can't search the combobox by the manufactuers - it's not gonna list them, just the names. I tried using a calculated field to achive this but it didnt work.

Thanks in advance.
Dennis
Top achievements
Rank 2
 answered on 11 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?