Editable grid view, disabled fileds are visible.

In a form in Editable grid mode, if I disable some fields with macro sc_field_display, when user click NEW, alla fileds show up.

Example:

I have 3 fields, name, email and age.

I hide age field, so I see only name and email, ok in visualization, ok on modify, but when I click NEW record, in the new row all fields are visible.

What’s the reason behind hiding the age field through code + macro instead of just not showing it?
Because if there isn’t really any then you could just go to Edit fields and drag the age field to the not shown section.

Actually name email and age were used just for explain the problem, my need is to edit some fields, and depending on some configuration, at run-time, some fields have to be visible and some not visible, it works fine for see and edit rows, not on new rows.

Use the sc_btn_new() macro in the onLoad event.

if(sc_btn_new)
{
sc_field_display({myfield},off);
}

jsb

I’ll try to move the code from Init to Load event… I’m asking what the Init event is for… thanks for the suggestion, I’ll let you know if it works.

That’s easy to find out.

http://www.scriptcase.net/docs/en_us/v8/manual_mp.htm#form-applications/form/events/events

jsb

well, your suggestion works, however , good to know that waht is set up in the event “loading” have to be done again in the event “loaded”, I’ll keep this as working, but I think that is not logical, if i set a filed hidden it have to stay hidden, if and when I want to show it again on a “new” record then I call diplay on, now I have to set display off for waht i already hidden.

thanks again jsbinca, I owe you a coffe :smiley: