Column hide :: Select Column :: Dynamic Column

Hi,

By default, grids column will show ALL the fields from your SQL statement.
Is there a way to tell scriptcase which fields to be shown during run time?
But user will still have the option which field to be shown or hide during run time.

Is like showing dynamic fields…

Hope someone can help me.
Thanks.

Re: Column hide :: Select Column :: Dynamic Column

Hi,
At design time, in the SC project, under grid - edit fields - you have the ability to drag the fields you want to be visible and hidden. As far as at run time, I haven’t done it, but there are macros that manipulate the fields, sort and where for grid sql, so that might be a start. In other words, you could always modify the sql in your grid, but doing it with the macros in the initscript event.

You can also modify what is shown in a field for each record, based on values and logic, using the onrecord event at run time.

Just some ideas. The macros and events are very powerful and give you lots of hooks into the apps.

As a last resort, if you had to have 100% control for some reason, that particular “grid” could really be done in a blank app, using the macros and some php code. But I bet you could get the effect you want in the grid itself.

peace,
Jamie

Re: Column hide :: Select Column :: Dynamic Column

Thanks Onmountain

I checked the manual http://downloads.scriptcase.com.br/downloads/v6/manual/en_us/webhelp/manual_mp/manual_mp.htm

At Scriptcase Macros->Event X applications, under grid column, onScriptInit event:
sc_field_display({My_Field}, on/off)

But what if the user manually select the field to show/hide, how can I detect whether to use a macro or the users field selection during run time?

Re: Column hide :: Select Column :: Dynamic Column

in Grid its not possible, only in form, that uses ajax events for example. In grid you can use like in the Webhelp sample, use a field as condition to show one fied or not.