Telerik Forums
Kendo UI for jQuery Forum
1 answer
65 views
I am having trouble trying to get value from the following sample json

[{"released":"2007-06-29","posters":[{"image":{"type":"poster","size":"thumb","height":118,"width":92,"url":"http://cf2.imgobject.com/t/p/w92/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"w154","height":197,"width":154,"url":"http://cf2.imgobject.com/t/p/w154/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"cover","height":237,"width":185,"url":"http://cf2.imgobject.com/t/p/w185/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"w342","height":439,"width":342,"url":"http://cf2.imgobject.com/t/p/w342/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"mid","height":641,"width":500,"url":"http://cf2.imgobject.com/t/p/w500/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}},{"image":{"type":"poster","size":"original","height":854,"width":666,"url":"http://cf2.imgobject.com/t/p/original/gMg48r3zMz6HMez4ksNEeOcrVV1.jpg","id":"4ea680f32c058837cb00c499"}}],"backdrops":[],"version":225,"last_modified_at":"2012-04-30 18:27:15 UTC"}]


How can I get the value of the "url" under "posters".  I thought this would work "posters[0].image.url" but it does not work....desperate for an answer.  Trying to meet contest deadline.
Duncan
Top achievements
Rank 1
 answered on 07 May 2012
0 answers
64 views
hello
is possible with some method that a grid is not editable is editable?
Thanks in advance.
Greetings!
Ricardo
Top achievements
Rank 1
 asked on 07 May 2012
11 answers
139 views
I am using the MVVM and Datasource frameworks with the Kendo UI controls, so the control is bound via MVVM to a shared datasource. This works well with all controls when updating values. It even works fine when completely deleting values of text-like controls. The issue is with numeric or date controls, where empty string is a violation, thus NULL is used.

So for DatePicker and NumericTextBox, when a value is already present, selecting the text in the control thru the UI and deleting it, does not update the underlying datasource. Thru inspection and walking code, I can see that the controls do indeed have their value set to NULL, so it appears to be in the observer and not the controls.

Anyone else unable to delete values successfully or is this just me??

Thanks!
Mike
Rosen
Telerik team
 answered on 07 May 2012
1 answer
321 views
Hi all

i have a grid (php/json datasource) and inline editing.

i need to validate the email address field but i have a problem.

if i define the field like this in my datasource.schema.model.fields :
EmailAddress:         { validation: { required: true}, type: "email" },
then validation works perfectly when editing existing entry.
but adding throws an error. (i dont think 'email' is a valid 'type')

i think i'll need to define the field like this:
EmailAddress:         { validation: { required: true}, type: "string" },
and validate the entry with a regex. but i cant figure out how.

i though i could add a 'format' to the above 'validation' tag but that doesnt work....

does anyone have experience with this please? i've very stuck.

thanks,
Vauneen



Sarvesh
Top achievements
Rank 1
 answered on 07 May 2012
1 answer
217 views
Hi , I am totally new user of kendo but i cant even bind the data yet please give me some solutions :

<!DOCTYPE html>
<html>
<head>
    <script src="jquery.min.js"></script>
    <script src="kendo.dataviz.min.js"></script>
    <script src="console.js"></script>
    <link href="kendo.dataviz.min.css" rel="stylesheet" />
</head>
<body>
<div id="example" class="k-content">
            <div class="chart-wrapper">
                <div id="chart"></div>
            </div>
<script>
 
        function createChart() {
                     
var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "deneme.json",
            dataType: "json",
            contentType: "application/json; charset=utf-8"
        }
    }
});
  
 $("#chart").kendoChart({
  dataSource: dataSource,
  theme: $(document).data("kendoSkin") || "default",
   legend: {
   position: "top",
 },
  chartArea: {
   background: "",
 },
 series: [{
  field: "value",
 }],
  categoryAxis: {
  field: "year",
 }
});
}
    
</script>
</div>
 
</body>
</html>





JSON FILE : 

[ { "year": "2000", "value": 200 }, 
  { "year": "2001", "value": 450 }, 
  { "year": "2002", "value": 300 }, 
  { "year": "2003", "value": 125 },
]




They all in same directory.... 


Thanks
King regards
Iliana Dyankova
Telerik team
 answered on 07 May 2012
0 answers
72 views
Trying to move from 2011.3.1413 to 2012.1.423 version.
Some columns in grid use FCBKcomplete(For it's tags support) widget in incell editor. This widget is composed of hidden select and visible text input. Problem is that text input is autobinded to datasource.
Here is small jsFiddle to illustrate - check the category column in edit mode.
I couldn't find a way to disable this autobinding behaviour. May be i just was looking in wrong direction.

PS: Sorry title must be "Trouble with incell editor..."
Sergey
Top achievements
Rank 1
 asked on 07 May 2012
6 answers
377 views
Hi,

I'm trying to build a billing system using a grid to select the items that are billable in a time range. I have the following php file that feeds the grid and handles the post as in the blog tutorials. When the Save button is clicked the grid posts to the php page correctly but the update does not happen and I get the following error in firebug:

a is undefined
http://localhost/...../kendo.all.min.js
Line 8

Here's the php code:

<?php
$link = mysql_pconnect("localhost", "user", "pass") or die("Unable To Connect To Database Server");
mysql_select_db("db-name") or die("Unable To Connect To DB");

// add the header line to specify that the content type is JSON
header("Content-type: application/json");

// determine the request type
$verb = $_SERVER["REQUEST_METHOD"];

// handle a GET
if ($verb == "GET") {

$arr = array();
$rs = mysql_query("SELECT
contracts_copy.contractID AS ID,
contracts_copy.artistID,
contracts_copy.contract_number AS Contract,
contracts_copy.play_date AS Date,
contracts_copy.billable AS Billable
FROM
contracts_copy
WHERE
contracts_copy.play_date >= '2012-01-01' AND
contracts_copy.offer_status = 'Confirmed'
");
 
while($obj = mysql_fetch_object($rs)) {
    $arr[] = $obj;
}

echo "{\"data\":" .json_encode($arr). "}";
}

    // handle a POST
if ($verb == "POST") {

     // get the parameters from the post. escape them to protect against sql injection.
    $Billable = mysql_real_escape_string($_POST["Billable"]);
    $Id = mysql_real_escape_string($_POST["ID"]);
    
    $rs = mysql_query("UPDATE contracts_copy SET billable = '" .$Billable."' WHERE contractID = '" .$Id."'");
   
   if ($rs) {
        echo json_encode($rs);
    }
    else {
        header("HTTP/1.1 500 Internal Server Error");
        echo "Update failed for ID: " .$Id;
    }
}
?>

When viewing the json directly in the browser it works fine. The post from the grid looks fine too:

models[0][Billable] true
models[0][Contract] EK.03.29-30.2012.HollySprings.NC
models[0][Date] 2012-03-29
models[0][ID] 2218
models[0][artistID] 73

The Billable field is the only editable one and is passed correctly. The response from json is also correct...true. But the table is not updated with the Billable value (true) and the grid doesn't show the update.

Here's my page code:

<div id="wrap" class="k-content">
<div id="example" class="k-content">
            <div id="grid"></div>

            <script>
                $(document).ready(function () {
                  dataSource = new kendo.data.DataSource({
                                transport: {
                                        read: "../data/billable.php",
                                        update: {
                                        url: "../data/billable.php",
                                        type: "POST"
                                            }
                                        },
                                    parameterMap: function(options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                },
                            
                            batch: true,
                            autoSync: true,
                             pageSize: 30,
                                schema: {
                                    data: "data",
                                model: {
                                    id: "ID",
                                    fields: {
                                        Contract: { editable: false },
                                        Date: { editable: false},
                                        Billable: {editable: true, type: "boolean" }
                                  
                                    }
                                }
                            }
                        });

                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 400,
                        toolbar: ["save", "cancel"],
                        columns: [
                            { field:"ID", title: "ID", width: "25px" },
                            { field: "Contract", title:"Contract", width: "150px" },
                            { field: "Date", title:"Date", width: "150px" },
                            { field: "Billable", width: "100px" }
                            ],
                        editable: true
                    });
                });
            </script>
        </div>


</div>

I hope someone can help. It's probably something simple I'm overlooking. It seems odd that I'd get the true response from my php/json page if the update didn't happen?

Any help is appreciated.
Tony
Alexander Valchev
Telerik team
 answered on 07 May 2012
5 answers
566 views
Is it possible to get serialized data from the tree view - json array or something?

Thank you for your help
Ingo
Alex Gyoshev
Telerik team
 answered on 07 May 2012
1 answer
169 views
I have a master and child grid that is being displayed.   When the child grid has only one row in it, it does not display any records.   If there are two or more, they become visible.

I have been able to add a second child record and then all of a suddent it shows up.   If I delete the second child record, the grid no longer shows any records.

What am I doing wrong?

Here is the master grid:
_createMasterGrid: function() {
    $(this._renderTo).kendoGrid({
        dataSource: this._masterDS,
        sortable: true,
        pageable: false,
        navigatable: true,
        filterable: true,
        detailInit: $.proxy( function(e) { this._detailInit(e) }, this ),
        columns: [
            { field: "BSROrder.Name", title: "BSROrder", width: 150 },
            { field: "_2", title: "Headcount", width: 250 },
            { field: "_6", title: "FTE", width: 100 },
            { field: "_7", title: "EmployeeName", width: 200},
            { field: "_10", title: "JobCode", width: 50 },
            { field: "_11", title: "JobTitle", width: 50 },
            { field: "_21", title: "JobTitle" }
        ]
    });
 
    return $(this._renderTo).data("kendoGrid");
},


Here is the child grid:
_detailInit: function(e) {
    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: this._createDetailDS(e),
        scrollable: false,
        sortable: true,
        navigatable: true,
        toolbar: ["create", "save", "cancel"],
        columns: [
            { field: "BSROrder.Name", title: "BSROrder", width: 150 },
            { field: "_2", title: "Headcount", width: 250 },
            { field: "_6", title: "FTE", width: 100 },
            { field: "_7", title: "EmployeeName", width: 200},
            { field: "_10", title: "JobCode", width: 50 },
            { field: "_11", title: "JobTitle", width: 50 },
            { field: "_21", title: "JobTitle" }
        ]
    });
},
 
_createDetailDS: function(e) {
    var ds = new kendo.data.DataSource({
        transport: {
            read: {
                url: this._url + "/BSROrders?BSROrder=MDX:[BSR Order].[" + e.data.BSROrder.ID + "].Children",
                dataType: "json"
            }
        },
        schema: {
            data: "BSROrdersResponse.Results.RowSet.Rows",
            model: {
                id: "BSROrder.ID",
                fields: {
                    "BSROrder.Name": { editable: true, type: "string" },
                    "_2": { editable: true, type: "string" },
                    "_6": { editable: true, type: "string" },
                    "_7": { editable: true, type: "string" },
                    "_10": { editable: true, type: "string" },
                    "_11": { editable: true, type: "string" },
                    "_21": { editable: true, type: "string" }
                }
            }
        }
    });
     
    return ds;
}





Rosen
Telerik team
 answered on 07 May 2012
1 answer
196 views
Hello,

I'm trying to sell KendoUI to my co workers and I would like to know if there's a demo web site (or a live web site) that has integrated most of Kendo UI components?

Showing each components individually is just not the same as showing a fully integrated web site.  Some success stories would also be usefull if I want to impress the other programers.
Dimo
Telerik team
 answered on 07 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?