Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #102509
    VAISHNAVI P
    Participant

    Hi,

    I wanted to know how to get editable (readonly) for cardview fields, Please let me know.

    #102515
    ivanpeevski
    Participant

    Hi vaishnavip,

    You can enable editing of the cardview fields by setting the editable property of the component.
    If editable is set to false, then the fields will be readonly.

    You can use the following code, for example, to get the current value of the editable property:

    const cardview = document.querySelector(‘smart-card-view’);
    let editable = cardview.editable;

    Please have a look at our demo page to see an example of editable cards.
    You can also read more about the editable property in our documentation:

    https://www.htmlelements.com/docs/cardview-api/#toc-editable_boolean

    I hope this will be of help!
    If you have any other questions, please do not hesitate to contact us again.
    Best Regards,
    Ivan Peevski
    Smart UI Team
    https://www.htmlelements.com/

    #102524
    VAISHNAVI P
    Participant

    Dear Ivan,

    Thank you for your reply. I want the user to not change some fields like id and date which are system generated .  I want only some fields to be disabled or not editable.

     

    #102531
    ivanpeevski
    Participant

    Hi vaishnavip,

    Thank you for the clarification. If you do not want to allow users to see or edit a field, you can simply not pass it in the columns property. The data will still be available inside the dataSource property.
    For example, please have a look at this demo. Here we pass an id property to the dataSource, but it is not displayed inside the cards. We can still get the id value using the dataSource property.

    However, if you need to show the card field, but you don’t want the users to edit it, then please see the DisableDataField() function in this demo.
    In the example above, the code disables all dataFields passed in the disabledFields Array, but the data is still displayed to the users.

    Please, let me know if any of these solutions will work for you!

    Best Regards,
    Ivan Peevski
    Smart UI Team
    https://www.htmlelements.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.