Telerik Forums
Kendo UI for jQuery Forum
2 answers
107 views
I have a URL link to a single packet non-array JSONP data.  I am having trouble configuring the Kendo DataSource to read it correctly.  I know it has something to do with the schema, but I am not finding a lot of documentation on the configuration parameters.  My JSON data looks like this:

{"results":{"data1":0.928287,"data2":0.966691,"data3":0.897367,"adataA":0.329710,"adataB":0.818630,"adataC":0.667666,"adataIA":0.983468,"adataIB":0.726931,"adataIC":0.848747,"active":0.616980,"active1":0.616980,"factor":0.553658,"efficiency":1.454451,"system":true,"alarm":true,"connect":false,"state":21.815668,"online":true},"timeoday":"5/4/20127:50 AM"}

I have verified that the JSON data is valid using JSONLint.  I have created a simple test HTML file to read this data from the service which looks like this:

<!DOCTYPE html>
<html>
<head>
    <title>datasource test</title>
    <script src="../../../js/jquery.min.js"></script>
<script src="../../../js/kendo.data.min.js"></script>
<script src="../../../js/kendo.dataviz.min.js"></script>

</head>
<body>  
        <div id="example">
            <script>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
//url: "http://search.twitter.com/search.json?q=HTML5",
url: "http://localhost:8080/APEI_Snap/APEI_Data_Snapshot/1",
dataType: "jsonp",
type: "GET"
}
},
schema: {
data: "results"
},
change: function() {
var view = this.view();
alert(kendo.stringify(view[0]));  //I know view[0] is wrong since I don't have an array....
}
});
dataSource.read();
            </script>
        </div>
</body>
</html>

I need to be able to pulls out the individual data points, which I will eventually bind to the dataviz objects.  Can someone help me figure out how to setup the datasource?  Thanks for any help you can provide.

Mark
Alex
Top achievements
Rank 2
 answered on 24 May 2012
1 answer
129 views
I waste a lot my time on internet just to find a tutorial bind data php with combobox, I don't know why have just a few of tutorials combobox and can't did something I want.

Someone help me please, the combobox not show any data, this is my code. Thank you for reading my topic

var pCate=new kendo.data.DataSource({
                  
                    transport:{
                        read:{
                             
                            url:"../data/product_cate.php",
                            dataType:'json'
                        }
                    }
                      
                      
                 });
 $("#cbProductCate").kendoComboBox({
                      index:-1,
                      dataTextField: 'name',
                      dataValueField: "id",
                      dataSource:pCate
                      
                  });
               
Quang
Top achievements
Rank 1
 answered on 24 May 2012
0 answers
305 views
It would be nice if there was a way to have Auto-complete fire when the text box is cleared.  I found the following example which shows clearing the filter using a button but it would be cleaner if once the textbox was empty if auto-complete cleared the filter.

http://jsfiddle.net/krustev/5f3x4/4/ 

Thanks,
Shane
Shane
Top achievements
Rank 1
 asked on 23 May 2012
2 answers
196 views
Is there an easy way to add a custom drop down to the editor tool menu?

Thanks!

EDIT - To be more clear, I want to add a new combobox to the menu in the same style as the defaults.
Jeff
Top achievements
Rank 1
 answered on 23 May 2012
0 answers
168 views
Hi,

I have already created a new kendo.data.dataSource with success, and I am able to bind it to the KendoUI Grid on my page.

But when I try to dataSource.insert(0, [a : "b"]); it removes the data that was there previously.

My example code follows:
var tempSource = new kendo.data.DataSource({
     data: [{"ID":1,"Name":"Cliente 1","NameID":"1 - Cliente 1"},{"ID":2,"Name":"Cliente 2","NameID":"2 - Cliente 2"}]
});

This is how I'm binding to the grid:
$("#association-grid").kendoGrid(
{
                    height: 99,
                    columns:
                    [
                        {
                            field: "ID",
                            title: "ID"
                        },
                        {
                            field: "Name",
                            title: "Name"
                        },
                        {
                            field: "NameID",
                            title: "NameID"
                        }
                    ],
                    dataSource: tempSource
                });

This is how I add a new item:
tempSource.insert(0, { ID: "John Smith", Name: "Product Description", NameID: "123 1st Street" });

If I perform the add before binding the data to the Grid, I lose the first two items that were originally on the dataSource object.

In summary:
I have a pre-created dataSource binded to a Grid. I want to be able to add a new item to the dataSource, and then refresh the Grid so that the new item appears.

Thanks,

LCG
Luis
Top achievements
Rank 1
 asked on 23 May 2012
3 answers
87 views
I have a grid using a data source with serverAggregates and serverFiltering set to false. The first time the remote data endpoint is queried, everything is fine. However, after the data comes back, I manually set some aggregates. Then, on a subsequent call to dataSource.read(), all of the aggregates are sent to the server in the query string. I'm not sure what to do, but this seems like a bug and is causing me problems in that I actually reach the query string length limit.

A sample url looks like this, decoded:

http://localhost:57135/ReportData?filter[logic]=and&filter[filters][0][field]=IsContractor&filter[filters][0][operator]=eq&filter[filters][0][value]=false&aggregate[0][field]=May_01&aggregate[0][aggregate]=sum&aggregate[1][field]=May_02&aggregate[1][aggregate]=sum&aggregate[2][field]=May_03&aggregate[2][aggregate]=sum&aggregate[3][field]=May_04&aggregate[3][aggregate]=sum&aggregate[4][field]=May_05&aggregate[4][aggregate]=sum&aggregate[5][field]=May_06&aggregate[5][aggregate]=sum&aggregate[6][field]=May_07&aggregate[6][aggregate]=sum&aggregate[7][field]=May_08&aggregate[7][aggregate]=sum&aggregate[8][field]=May_09&aggregate[8][aggregate]=sum&aggregate[9][field]=May_10&aggregate[9][aggregate]=sum&aggregate[10][field]=May_11&aggregate[10][aggregate]=sum&aggregate[11][field]=May_12&aggregate[11][aggregate]=sum&aggregate[12][field]=May_13&aggregate[12][aggregate]=sum&aggregate[13][field]=May_14&aggregate[13][aggregate]=sum&aggregate[14][field]=May_15&aggregate[14][aggregate]=sum&aggregate[15][field]=May_16&aggregate[15][aggregate]=sum&aggregate[16][field]=May_17&aggregate[16][aggregate]=sum&aggregate[17][field]=May_18&aggregate[17][aggregate]=sum&aggregate[18][field]=Total&aggregate[18][aggregate]=sum&aggregate[19][field]=Difference&aggregate[19][aggregate]=sum

The columns listed are in my data source's aggregates, but they shouldn't be sent to the server.
Brian Vallelunga
Top achievements
Rank 1
 answered on 23 May 2012
5 answers
524 views
How do I update a piece of data in an existing dataset? The following is the code I have for updating and adding to an existing dataset, the add works correctly, but how do I make the update work?

function AddEntityToDataSource(entityset, entity) {
 
    var ds = GetDataSource(entityset);
 
    ds.add(entity);   
     
}
 
function UpdateEntityToDataSource(entityset, entity) {
 
    var ds = GetDataSource(entityset);
 
    entity = ds.get(entity.id);
 
}


John
Top achievements
Rank 1
 answered on 23 May 2012
2 answers
61 views
It's a list of items, the calendar is bound to a date value on the "SelectedItem"

So when selected item changes I want to show the value in the calendar.

However what's happening is that the calendar just keeps animating (rather choppy) back to may 2012 over and over with no selected dates.

This is the date value I'm binding to "2013-04-01T00:00:00"

Here's the markup
<li>Starts: <span data-role="calendar" data-bind="value: selectedBlock.data.StartDate"></span></li>

ideally i'd like no animation, and just want to visualize the dates
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 23 May 2012
1 answer
248 views
Is there is any way that I can show all my validation messages on a window (or a dialog). My client don't want the messages on the right of each input boxes?
Iliana Dyankova
Telerik team
 answered on 23 May 2012
0 answers
137 views
hi,
i am able to load the grid from the database.i have an image field in my database,i want to display image in the grid.now it is showing undefined in the image field.can u tell me how to insert an image.
and also i want to use check box,radio button,combo box and link.what is the "type" i have to give for these fields.
charan
Top achievements
Rank 1
 asked on 23 May 2012
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?