3 Answers, 1 is accepted
0

KMILO
Top achievements
Rank 2
answered on 06 Aug 2012, 02:00 PM
I was playing around trying to get myself the answer for this and I think I get it, the solution was made using template columns (example below), please note that the last column is not a command type, is a field type; and it has a function calling inside that based on object fields takes a route on if sentence and it renders the desired control as HTML, the tricky part of this is the look and feel... the class that belongs to the button must be the most similar possible to the original command button of kendo grid, I hope that this little research works for someone with the same issue as me.
If someone on Telerik could validate if its the best way to achieve that, please add your comments.
Thank you!
KMI
If someone on Telerik could validate if its the best way to achieve that, please add your comments.
Thank you!
KMI
if
(gridRecv == undefined) {
gridRecv = $(dvName).kendoGrid({
dataSource: {
pageSize: 4,
data: data
},
pageable:
true
,
scrollable:
true
,
sortable:
true
,
filterable:
true
,
reorderable:
true
,
resizable:
true
,
height: 225,
columns: [
{ field:
"UniqueId"
, title:
"ID"
},
{ field:
"NombreAgenteSolicitante"
, title:
"Enviado Por"
},
{ field:
"FechaEnvio"
, title:
"Fecha Envio"
},
{ field:
"EstadoSolicitud"
, title:
"Estado"
},
{ command: { text:
"Ver"
, click: viewFile }, title:
" "
},
{ command: { text:
"Rechazar"
, click: deniedInquiry }, title:
" "
},
{ command: { text:
"Aprobar"
, click: acceptInquiry }, title:
" "
},
{ command: { text:
"Firmar"
, click: signInquiry }, title:
" "
},
{field:
"UniqueId"
, title:
" "
, template: getTemplate }
]
}).data(
"kendoGrid"
);
}
else
{
reloadTheGrid(dvName, data);
}
}
function
getTemplate(e) {
var
tmpCol;
var
UniqueId = e.UniqueId;
if
(e.FirmadoPorEmisor && e.FirmadoPorReceptor) {
tmpCol =
"<input id='btnSign_"
+ UniqueId +
"' style='width:50px;' class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' onclick='signInquiry("
+ UniqueId +
");return false;' value='Enviar'/>"
;
}
else
{
tmpCol =
"<input id='btnSign_"
+ UniqueId +
"' style='width:50px;' disabled='disabled' class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' onclick='signInquiry("
+ UniqueId +
");return false;' value='Enviar'/>"
;
}
return
tmpCol;
}
0

Brandon
Top achievements
Rank 1
answered on 23 Apr 2013, 10:10 PM
I realize this is an old topic, but I would like an answer on this as well.
The problem with using templates to get a piece of functionality that isn't provided isn't that it is hard to implement, it's that it starts you from square one. You have to import all of the proper classes and even then you might lose some of the original functionality due to the UI element not being generated via Kendo.
The problem with using templates to get a piece of functionality that isn't provided isn't that it is hard to implement, it's that it starts you from square one. You have to import all of the proper classes and even then you might lose some of the original functionality due to the UI element not being generated via Kendo.
0
Hi Brandon,
Vladimir Iliev
the Telerik team
Your question is not related to the original topic of this support conversation, so please submit a new support ticket for it with more information about what exactly you are trying to achieve. In this way you can be sure that your query will reach the corresponding staff member in time and will be answered faster and accurately.
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!