This is a migrated thread and some comments may be shown as answers.

Grid Create Template

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anil
Top achievements
Rank 1
Anil asked on 03 May 2013, 02:27 PM
I have a kendo data source is bound to the grid using declarative style binding  "data-bind="source: ". I currently built my view along the lines of the grid-crud code library project using MVVM. I have the following questions
  1. I create a sepereate html <section> and bound the elements to the view model. On the create button i did a kendo data source add. However this adds to the grid collection and does not call my controller method bound to my transport. How can i make the add call the transport?
  2.  Is there an example (jsfiddle,jsgrid,codelibrary etc) which shows a form for the grid outside the confines of the grid. I cannot use the popup template as my behavior is such that the original grid should be hidden on click of an edit command. Please advise

var viewModel = kendo.observable({
ordersSource: statesDataSource,
isActive: true,
tabSelected: function (e) {
var selectedTab = $(e.item).text().trim();
this.set("isActive", (selectedTab === "Active"));
},
stateName: "",
stateAbbreviation: "",
isActive: true,
createState: function () {
debugger;
statesDataSource.add({
stateLookupID: 0,
stateName: viewModel.get("stateName"),
StateAbbreviation: viewModel.get("StateAbbreviation"),
isActive: viewModel.get("isActive")
});
}
});

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 07 May 2013, 07:39 AM
Hello Anil,

  1. Indeed calling the addRow of the Grid will add insert new item in the dataSource, however this wont perform any request. To execute to request you need to synchronize the dataSource with the sync method. More detailed information about the dataSource is available in the API reference links.
  2. If I understand your question correctly you are trying to bind an item from the Grid to another element and edit it through it. I believe what you are trying to achieve is covered in this code library.

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Anil
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or