Open Closed

Add Row Action button with condition in Data table #501


User avatar
0
Leaf created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.2.1
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi ,

I would like to add row action button in datatable, for this row actions button, if the Status == 'New' then the action button will show, if not then will hide the button. I have try the below method but is doesn't work, Is there anyway to make it work ?

Thank you.

Regards, Leaf


6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    Try:

    visible : function(data){
       return data == 'New';
    }
    
  • User Avatar
    0
    Leaf created

    Hi @liangshiwei,

    Tested, no error when running, but it is not working. The actions button still no show when the data == 'New'.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @Leaf

    Maybe you should access the property of data.record.

    visible : function(data){
        //data.record.status 
       return data.record.xxx == 'New';
    }
    
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    The data is a json object, just an example:

  • User Avatar
    0
    Leaf created

    Hi,

    I have tried for both return data.record.xxx and return data.xxx, still not working.

    For the data type is comfirmed correct as i have use the same data type to shown in datatable column as text.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi, we can use zoom to remote. My email : shiwei.liang@volosoft.com You can send an email to me, I will send the zoom link.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 15, 2025, 10:28