Note that there are some explanatory texts on larger screens.

plurals
  1. PONewly added data not saved properly in kendo grid
    primarykey
    data
    text
    <p>Grid behavior not as expected when the following actions are done .</p> <ol> <li>add new record</li> <li>then press update button in the grid(new added row)</li> <li>then press cancel before save .</li> </ol> <p>when above action is complete new added row disappears . <a href="http://jsfiddle.net/FWPgz/" rel="nofollow">link to js fiddle</a></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Demo Grid App&lt;/title&gt; &lt;!-- CDN-based stylesheet reference for Kendo UI DataViz --&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css"&gt; &lt;link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css"&gt; &lt;!-- CDN-based script reference for jQuery; utilizing a local reference if offline --&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt; &lt;!-- CDN-based script reference for Kendo UI DataViz; utilizing a local reference if offline --&gt; &lt;script src="http://cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt; &lt;h1&gt;Demo Grid App&lt;/h1&gt; &lt;/header&gt; &lt;div id="grid"&gt;&lt;/div&gt; &lt;script&gt; var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne", "Nige"], lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth", "White"], cities = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "Philadelphia", "New York", "Seattle", "London", "Boston"], titles = ["Accountant", "Vice President, Sales", "Sales Representative", "Technical Support", "Sales Manager", "Web Designer", "Software Developer", "Inside Sales Coordinator", "Chief Techical Officer", "Chief Execute Officer"], birthDates = [new Date("1948/12/08"), new Date("1952/02/19"), new Date("1963/08/30"), new Date("1937/09/19"), new Date("1955/03/04"), new Date("1963/07/02"), new Date("1960/05/29"), new Date("1958/01/09"), new Date("1966/01/27"), new Date("1966/03/27")]; function createRandomData(count) { var data = [], now = new Date(); for (var i = 0; i &lt; count; i++) { var firstName = firstNames[Math.floor(Math.random() * firstNames.length)], lastName = lastNames[Math.floor(Math.random() * lastNames.length)], city = cities[Math.floor(Math.random() * cities.length)], title = titles[Math.floor(Math.random() * titles.length)], birthDate = birthDates[Math.floor(Math.random() * birthDates.length)], age = now.getFullYear() - birthDate.getFullYear(); data.push({ Id: i + 1, FirstName: firstName, LastName: lastName, City: city, Title: title, BirthDate: birthDate, Age: age }); } return data; } function generatePeople(itemCount, callback) { var data = [], delay = 25, interval = 500, starttime; var now = new Date(); setTimeout(function() { starttime = +new Date(); do { var firstName = firstNames[Math.floor(Math.random() * firstNames.length)], lastName = lastNames[Math.floor(Math.random() * lastNames.length)], city = cities[Math.floor(Math.random() * cities.length)], title = titles[Math.floor(Math.random() * titles.length)], birthDate = birthDates[Math.floor(Math.random() * birthDates.length)], age = now.getFullYear() - birthDate.getFullYear(); data.push({ Id: data.length + 1, FirstName: firstName, LastName: lastName, City: city, Title: title, BirthDate: birthDate, Age: age }); } while(data.length &lt; itemCount &amp;&amp; +new Date() - starttime &lt; interval); if (data.length &lt; itemCount) { setTimeout(arguments.callee, delay); } else { callback(data); } }, delay); } $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { data: createRandomData(10), schema: { model: { id:"FirstName", fields: { LastName: { type: "string" }, City: { type: "string" }, Title: { type: "string" }, BirthDate: { type: "date" }, Age: { type: "number" } } } }, pageSize: 10 }, height: 500, width:300, toolbar: ["create"], scrollable: true, sortable: true, filterable: true, pageable: { input: true, numeric: false }, columns: [ { field: "LastName", title: "Last Name", }, { field: "City", }, { field: "Title" }, { field: "BirthDate", title: "Birth Date", template: '#= kendo.toString(BirthDate,"MM/dd/yyyy") #' }, { field: "Age", width: 50 }, { command: ["edit", "destroy"], title: "&amp;nbsp;", width: "210px" }, ], editable: "inline" }); }); &lt;/script&gt; &lt;div role="main"&gt; &lt;/div&gt; &lt;footer&gt; &lt;/footer&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload