Hi is there any way we can hide edit button of inline as below.?
We just want to keep delete if possible.
Hi is there any way we can hide edit button of inline as below.?
We just want to keep delete if possible.
Hello @Rinu,
To hide the edit option, please, add the following code to JavaScript editor:
fd.spRendered(function() {
fd.control('SPDataTable1').ready().then(function(dt) {
$($(dt.$el).find('.k-header')[1]).hide();
});
});
And the following style to CSS editor:
.fd-command-cell{
display: none!important;
}
Thanks Mnikitina,
This is not related to the above question but some what important.
We have a validation check to see if there is any record in the forms as below.
if (fd.control("SPDataTable1").widget.dataItems().length == 0) {
this.error = "Add at least one asset to cart before submitting";
return false;
}
You can add a custom validator that will check if control has unsaved lines. Please find the code below.
fd.validators.push({
name: 'MyCustomValidator',
error: "Please save rows",
validate: function(value) {
return fd.control('SPDataTable0').widget.element.find('.k-i-check').length==0;
}
});
Hello,
Can you please suggest how can I hide just the row save button in list or library control.
Hello @aseem,
What is your use case? How will users save changes to the row?
Hi Margo, it saves when the user clicks submit button. Also, looks like it saves the row after click New button as well.
You can hide it with CSS:
a.k-button.k-button-icontext.k-primary.k-grid-update {
display: none
}
Thank you! I'll try it. One last question on list or library I tried to use the code from here Lookup and people picker appears as a link in form - #5 by Vasilii_Burca to display user field value as text, but it is not working. Any suggestions?
Please share the code you are suing to remove the link
here is the code:
fd.control('ListOrLibrary1').templates = {
// LookupColumn is the column name
Name: function(ctx) {
var value = ctx.row.Name;
if (!value) {
return '';
}
return value.map(function(v) {
return v.lookupValue;
})
}
}
The Person or Group field value is an object with properties:
To display the name of the user without the link you need to replace lookupValue with title like so:
fd.control('ListOrLibrary1').templates = {
// LookupColumn is the column name
Name: function(ctx) {
var value = ctx.row.Name;
if (!value) {
return '';
}
return value.map(function(v) {
return v.title;
})
}