selectItem
Gets or sets the table row which is selected.
Parameters
row Element|jQuery
A DOM element or a jQuery object which represents the table row.
Returns
jQuery
—The selected table row.
Example - selecting a table row
<button id="btn">Highlight the second row</button>
<div id="propertyGrid"></div>
<script>
$("#propertyGrid").kendoPropertyGrid({
model: {
foo: "bar",
baz: 5
},
width: 500
});
$("#btn").click(function(){
var component = $("#propertyGrid").data("kendoPropertyGrid");
component.selectItem($("#propertyGrid tbody>tr:nth(1)"));
});
</script>
Example - getting the selected table row
<button id="btn">Get selected row info</button>
<div id="propertyGrid"></div>
<script>
$("#propertyGrid").kendoPropertyGrid({
model: {
foo: "bar",
baz: 5
},
width: 500
});
$("#btn").click(function(){
var component = $("#propertyGrid").data("kendoPropertyGrid");
var row = component.selectItem();
if(row.length > 0){
var data = component.dataItem(row);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(data.value);
}
});
</script>