Hide Edit in inline mode - List and library control

Hi is there any way we can hide edit button of inline as below.?
image

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;
	    }   


Which works fine except, in List and library edit mode even if you dont click the tick as shown above the form will allow to submit as long as there are some values on the form. is there a work around for this?

@Rinu,

@noorshahida88,

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;
    }
});
1 Like