Table columns visibility to other users

Continuing the discussion from List/Grid View - Order of Columns:

Hi @foxchikuns,

If you want to hide then check the syntax.

// 1
cur_frm.fields_dict['your_table_name'].grid.wrapper.find('div.d-flex').css({'visibility':'hidden'});

// 2
cur_frm.fields_dict['your_table_name'].grid.wrapper.find('.btn-open-row').hide();

// To hide them with a specific user
if (frappe.session.user == "user1@test.com" || frappe.session.user == "user1@test.com") {
    cur_frm.fields_dict['your_table_name'].grid.wrapper.find('div.d-flex').css({'visibility':'hidden'});
    cur_frm.fields_dict['your_table_name'].grid.wrapper.find('.btn-open-row').hide();
}

I hope this helps.

Thank You!

2 Likes