or
How can i make certain columns non-editable in data grid. I'm using Kendo UI for JSP. I tried editable="false" but gives error not an acceptable attribute.
Hi There,
It would be nice if i could do that:
<
kendo:grid
name
=
"verbrauchsprofile"
<c:if
test
=
"hasPermissionToCreate"
>
<
kendo:grid-toolbar
>
<
kendo:grid-toolbarItem
name
=
"create"
text
=
"Neues Verbrauchsprofil"
/>
</
kendo:grid-toolbar
>
</
c:if>
.....
</
kendo:grid
>
now there is an Exception
javax.servlet.jsp.JspException: The <kendo:grid-toolbarItem> tag should be nested in a <kendo:grid-toolbar> tag.
at com.kendoui.taglib.BaseTag.findParentWithClass(BaseTag.java:133)
at com.kendoui.taglib.grid.ToolbarItemTag.doEndTag(ToolbarItemTag.java:21)
By disallowing other Tags than Kendo Tags, you obstruct many opportunities of what you can do.
I need that to check permissions, and so on and not every tag has an "hidden" attribute to change its visibility
<
c:url
value
=
"/grid/instance/sort"
var
=
"transportReadUrl"
/>
<
c:url
value
=
"/grid/status/read"
var
=
"statusReadUrl"
/>
<
kendo:grid
name
=
"grid"
pageable
=
"true"
sortable
=
"true"
height
=
"440px"
>
<
kendo:grid-toolbarTemplate
>
<
div
class
=
"toolbar"
>
<
label
class
=
"category-label"
for
=
"statuses"
>Show forms by status:</
label
>
<
kendo:dropDownList
name
=
"statuses"
optionLabel
=
"All"
dataTextField
=
"statusDisplay"
dataValueField
=
"statusId"
autoBind
=
"false"
change
=
"statusChange"
>
<
kendo:dataSource
>
<
kendo:dataSource-transport
>
<
kendo:dataSource-transport-read
url
=
"${statusReadUrl}"
/>
</
kendo:dataSource-transport
>
</
kendo:dataSource
>
</
kendo:dropDownList
>
</
div
>
</
kendo:grid-toolbarTemplate
>
<
kendo:grid-pageable
pageSizes
=
"true"
refresh
=
"true"
buttonCount
=
"3"
></
kendo:grid-pageable
>
<
kendo:grid-sortable
allowUnsort
=
"true"
mode
=
"multiple"
/>
<
kendo:dataSource
pageSize
=
"10"
serverPaging
=
"true"
serverSorting
=
"true"
>
<
kendo:dataSource-transport
>
<
kendo:dataSource-transport-read
url
=
"${transportReadUrl}"
type
=
"POST"
contentType
=
"application/json"
/>
<
kendo:dataSource-transport-parameterMap
>
function(options){return JSON.stringify(options);}
</
kendo:dataSource-transport-parameterMap
>
</
kendo:dataSource-transport
>
<
kendo:dataSource-schema
data
=
"data"
total
=
"total"
groups
=
"data"
></
kendo:dataSource-schema
>
</
kendo:dataSource
>
<
kendo:grid-columns
>
<
kendo:grid-column
title
=
"REF#"
field
=
"instanceId"
width
=
"100px"
filterable
=
"false"
/>
<
kendo:grid-column
title
=
"Submitter"
field
=
"owner"
width
=
"200px"
/>
<
kendo:grid-column
title
=
"Status"
field
=
"status"
width
=
"200px"
/>
<
kendo:grid-column
title
=
"Form"
field
=
"shortName"
/>
</
kendo:grid-columns
>
</
kendo:grid
>
function
statusChange() {
var
value =
this
.value(), grid = $(
"#grid"
).data(
"kendoGrid"
);
if
(value) {
grid.dataSource.filter({ field:
"statusId"
, operator:
"eq"
, value: parseInt(value) });
}
else
{
grid.dataSource.filter({});
}
}
function
statusChange() {
var
value =
this
.value(), grid = $(
"#grid"
).data(
"kendoGrid"
);
if
(value) {
var
filter = {
logic :
"and"
,
filters: [
{
field :
'statusId'
,
value : parseInt(value),
operator :
'eq'
}
]
};
}
else
{
var
filter = {};
}
grid.dataSource.filter(filter);
http:
//localhost:8080/api/leads?page=2&size=20&sort=firstName,desc -> or asc