Telerik Forums
Kendo UI for jQuery Forum
1 answer
141 views
Hi all,

Ok I have put a problem that many people read but nobody answered. So i guess it would be usefull to make a clearer explaination:

I have a very basic kendo grid bind to odata dataservice:
-----------------------------------------------------------------------

var

myDS = new kendo.data.DataSource({
type: "odata",
transport: {
//read: { url: "/Ajax/Lists/PassagesReports/LightService.svc/PRs/"
read: { url: "/testprs.js" //I put example here of JSON return by Odata so u can test
}},
schema: {
model: {
id:
"SeqId",
fields: prLight}},
pageSize: 10,
serverPaging:
true,
serverFiltering:
true,
serverSorting:
true,
sort: { field:
"SeqId" }
});

//I load it with:
//---------------
$(document).ready(

function () {
$(
"#gridPRs").kendoGrid({
dataSource: myDS,
height:
"auto",
scrollable:
false,
filterable:
true,
columns: [ { title: "Seq.", field: "SeqId", width: "65px", template: "<div class='dprcolpad'>#= SeqId #</div>" },{ title: "Lane", field: "LineId", width: "165px", template: "<div class='dprcolpad'>#= GetLine(LineId) #</div>" },{ title: "Description", width: "230px", field: "Description", template: "<div class='dprcolpad'>#= Description #</div>" }
],
sortable: {
mode: "single",
allowUnsort:
false
},
pageable:
true});

 //Here i defined button add click
//----------------------------------
$("#btadd").click(function () {
prLight.SeqId = "11";
prLight.LineId = 20;
prLight.Description = "London";
myDS.add(prLight);

});
});

//I defined my object :
-----------------------
var prLight = {
SeqId: { type: "string", filterable: false },
LineId: { type:
"number" },
Description: { type: "string" }};

//and finaly and example of odata that u can put in js file testprs.js to make all work:
----------------------------------------------------------------------------------------
 callback({"d" : {"results": [{"SeqId": "1", "LineId": 0, "Description": "London"}, {"SeqId": "5", "LineId": 1, "Description": "Mexico"}], "__count": "2"}})

Ok so far so good. so what the problem then? well if you click add button you get a very strange error :

 "d.d is undefined" from kendo.core.js.

if you change data type from odata to json. it works well. (But i want to use dataservice and odata in this case.

Any one can help?

Thanks
Laurent


T.
Top achievements
Rank 1
 answered on 27 Aug 2012
1 answer
148 views
I need to get the row identity value of the newly created record so that I can tie it to other data. How can I extract the results in the change event?

For example...

var dsEmployee = new kendo.data.DataSource({
 type: "odata",
 transport: {
  read: {
   url: baseUrl + "/DataService.svc/Employees",
   dataType: "json"
  },
  create: {
   url: baseUrl + "/DataService.svc/Employees",
   type: "POST",
   dataType: "json"
  },
  update: {
   url:  function (o) {
    return baseUrl + "/DataService.svc/Employees(" + o.EmployeeId + ")"
   },type: "PUT",
   dataType: "json"
  }
 },
 schema: {
  model: Employee
 },change: function (e) {
  ...
 
 }
}
Rosen
Telerik team
 answered on 27 Aug 2012
0 answers
79 views
Hello,
I´m new in kendo UI development. I´ve already developed an app for WP 7.5, and now, my goal is to change it for other plataforms. 
Here in the firm, we would like to develop an app for Blackberry OS, but, Is there a emulator that is possible view the app? 

As more questions arise, we´ll post to solve them.

Thanks in advance,

Thiago
Thiago
Top achievements
Rank 1
 asked on 27 Aug 2012
2 answers
74 views
At first I have discovered incorrect behavior of a grid in the my project, but you can see this bug in behaviour of a grid in demo examples: Inline editing and Popup editing. This bug does not allow modifying of data in the newly added record. The sequence of user actions leading to bug is shown in the attached image (inline editing).

Rosen
Telerik team
 answered on 27 Aug 2012
1 answer
128 views
Hi guys, I've got a strange problem with my grid that has server side paging.

what we have done is abstract the the Kendo grid away from out current code using obtrusive javascript like so

   var options = {
        reorderable: $(element).attr("data-grid-reorderable"),
        autoBind: $(element).attr("data-grid-autoBind"),
        groupable: $(element).attr("data-grid-groupable"),
        width: $(element).attr("data-grid-width"),
        height: "400",
        scrollable: true,
        columns: columns,
        dataSource: {
            transport: { read: { url: $(element).attr("data-grid-datasource-url"), data: window[$(element).attr("data-grid-datasource- data")] } },
            sortable: { mode: "multiple", allowUnsort: true },
            type: "aspnetmvc-ajax",
            filter: [],
            group: groups,
            schema: {
                data: $(element).attr("data-grid-schema-data"),
                total: $(element).attr("data-grid-schema-total"),
                errors: $(element).attr("data-grid-schema-errors"),
                model: model,
                scrollable: true
            },
            pageSize: $(element).attr("data-grid-datasource-pagesize"),
            serverPaging: $(element).attr("data-grid-datasource-pageable"),
            serverFiltering: $(element).attr("data-grid-datasource-filtering"),
            serverSorting: $(element).attr("data-grid-datasource-sortable")
        },
        pageable: $(element).attr("data-grid-pageable"),
        columnMenu: true
    };

this all works fine for the first page of the grid but the problem is when the page changes we return the data in exactly the same data structure that worked on page 1 but it doesn't work on page 2? the grid is just empty.

Can anyone help with this? it's a very strange issue because it works perfectly fine on the first page.

cheers.
ste.
Daniel
Telerik team
 answered on 27 Aug 2012
0 answers
83 views
I would like to have a ComboBox for the user to choose when a row is going to be updated.

How could I make a row template for update in which, a ComboBox is used for some fields?

Thanks.
danny
Top achievements
Rank 1
 asked on 27 Aug 2012
3 answers
72 views
Hi, According to my new requirement i have to modify some Wizard UI functionality and it's CSS styles. My question is how to inherit Kendo UI JS and CSS in my project? Is there any Intelligence support for Visual Studio 2010 or Is there any Intelligence support for any other development IDE? 

  
Daniel
Telerik team
 answered on 27 Aug 2012
0 answers
177 views

Code:

$("#DropDownList1").change(function () {
   custCode
= $("#DropDownList1").val();

   $
("#titles").data("kendoDropDownList").dataSource.read(); //shows list Loading But Same Data Is present .
   $
("#titles").data("kendoDropDownList").refresh(); //NOT Working

});

I am Tring to refresh my DropDownList after another DropDownList ..
is clicked but the refresh Method is not define error pops.
therefor i use the dataSource.read() then the DropDownList Shows it loading but data remain the same
Chanaka
Top achievements
Rank 2
 asked on 26 Aug 2012
3 answers
564 views
Hello,

I would like to know if window content can close the window?

Here's my code so far:
<div id="myWindow">
    <button onclick="CloseWindow()" >Close Me</button>
 
    <script type=text/javascript>
 
        function CloseWindow() {
 
            try {
                var kendoWindow = $("#myWindow").data("kendoWindow").close();
            }
            catch (err) {
                //Unable to get value of the property 'close': object is null or undefined
                alert("Error \n\n" + err.message);
            }
                                 
        }
      
    </script>
</div>
 
<script>
    $(document).ready(function () {
 
        var myWindow = $("#myWindow").kendoWindow({
            width: "300px",
            height: "200px",
            title: "Login",
            modal: false
        });
 
    });
</script>


Unfortonately, the following error is raised when trying to close the window:
Unable to get value of the property 'close': object is null or undefined

I would also like to know if there is a solution that would also work with external content?
Ex:
var myWindow = $("#myWindow").kendoWindow({
    width: "300px",
    height: "200px",
    title: "Login",
    modal: false,
    content: "myExternalContent.aspx"
});

... where myExternalContent.aspx would be able to access myWindow and close it even if it's not in the same page.

Best regards,

Simon


Dennis
Top achievements
Rank 1
 answered on 26 Aug 2012
4 answers
1.3K+ views
Is there a way to change the default "Select..." text on the button?  Thanks.
Gedalias
Top achievements
Rank 1
 answered on 26 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?