<html>
<head>
<meta charset=utf-8 />
<title>Kendo UI Baseline</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--Kendo UI Styles-->
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.common.min.css" rel="stylesheet"/>
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.blueopal.min.css" rel="stylesheet"/>
</head>
<body>
<!--Scripts-->
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1315/js/kendo.all.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1315/js/kendo.web.min.js"></script>
<script src="http://demos.kendoui.com/content/shared/js/people.js"></script>
<script>
var datavalue = [];
datavalue.push({TypeValue: "---" });
datavalue.push({ TypeValue: "New" });
datavalue.push({ TypeValue: "Important" });
datavalue.push({ TypeValue: "Remark" });
datavalue.push({ TypeValue: "Complaint" });
var dropDownDataSource = new kendo.data.DataSource({
data: datavalue,
schema: {
model: {
fields: {
TypeValue: { type: "string" }
}
}
}
});
</script>
<script id="popup_editor" type="text/x-kendo-template">
<p>Custom editor template</p>
<div class="k-edit-label">
<label for="Date">Date</label>
</div>
<!-- datepicker editor for field: "Date" -->
<input type="text"
name="Date"
data-type="date"
data-bind="value:BirthDate"
data-role="datepicker" />
<div class="k-edit-label">
<label for="Type">Type</label>
</div>
<!-- drop down list editor for field: "Type" -->
<input name="TypeValue"
data-bind="value:TypeValue"
data-value-field="TypeValue"
data-text-field="TypeValue"
data-source="dropDownDataSource"
data-role="dropdownlist" />
<div class="k-edit-label">
<label for="NoteBy" style="color: red;">NoteBy</label>
</div>
<!-- textbox editor for field: "NoteBy" -->
<input type="text" class="k-input k-textbox" name="NoteBy" data-bind="value:NoteBy"/>
<div class="k-edit-label">
<label for="Description">Description</label>
</div>
<input type="text" class="k-input k-textbox" name="Description" data-bind="value:Description"/>
</script>
<div id="NoteGrid" style="height: 380px"></div>
<script>
$(document).ready(function() {
$("#NoteGrid").kendoGrid({ // create Grid from div HTML element Kendo
dataSource: {
data: [],
schema: {
model: {
fields: {
Date: { type: "date" },
TypeValue: { type: "string"},
NoteBy: { type: "string" },
Description: { type: "string" }
}
}
}
},
selectable: "row",
scrollable: true,
navigatable: true,
sortable: true,
resizable: true,
groupable: false,
filterable: true,
columnMenu: true,
columns: [
{
field: "Date",
title: "Date",
width: 80
},
{
field: "TypeValue",
title: "Type",
width: 60
},
{
field: "NoteBy",
title: "Note By",
width: 80
},
{
field: "Description",
title: "Description",
width: 100
},
{
command: [
{ name: "edit",
text: { update: "Save" }
}],
hidden: true
}
],
toolbar: ["create"],
edit: function (e) {
// $("#editor").kendoEditor();
e.container.data("kendoWindow").title("Add Note");
e.container.find('.k-grid-update').css('float', 'right');
e.container.find('.k-grid-cancel').css('display', 'none');
},
editable: {
mode: "popup",
template: kendo.template($("#popup_editor").html())
},
save: function (e) {
var grid = $("#NoteGrid").data("kendoGrid");
grid.refresh();
},
detailInit: function (e) {
var grid = $("#NoteGrid").data("kendoGrid");
grid.element.find('tbody tr:first').addClass('k-state-selected')
}
});
});
</script>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |