No announcement yet.

Button "Columns" in Form editable grid view?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Button "Columns" in Form editable grid view?

    Hi all

    I am about to create a editable form grid with a lot of columns. Most of SCīs functions are intuitive and convenient to implement, although some features are missing missing and detailed documentation.
    But I was really wondering why there is no "columns" button in the toolbar of the form grid like there is one in the normal grid view. Why is it not possible to turn on and off columns in a form-grid at run-time?
    Would be so logical, I mean.
    Iīm now trying to reconstruct the little select-columns form like in the grid view app, but found it rather painful/senseless to re-program an already existing feature, which seems to have been forgotten.

    Is there someone out there, who would be so kind to give me some hints for a work-around. Or have I missed any crucial features?
    Thanks a lot


  • #2
    You can apply fields to a group and hide / unhide these groups of fields by using a scriptcase macro. You can apply ajax events on checkboxes to makes group visible or hide but also apply buttons in toolbars to achieve this. Also you can hide individual fields etc.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thanks for your answers. :-)
      Some of these I tried already, but did not satisfy too much, because I have to handle more than 25 columns individually. So own buttons per each column would completely bloat the toolbar. The original function (having a own form (in modal view)), which lists all table fields with checkboxes would be optimal. I managed already to dynamically load all field names from the table and show them as checkboxes list in an own modal form view. But now I need to send the active fields to the main form grid and tell the form grid to only show these. Hm.
      However, -for me- this feels like a missing crucial feature in SC.

      How can I apply fields to a group? Somehow I seem to have ignored this feature.
      Thanks a lot


      • #4
        If you are choosing a case-tool for generating applications then you know that you will need to remain between the boundaries of the product. If you go out of bounds you can apply your own code in a blank application. To group fields:
        go to layout and add one or more blocks. then go to fields position and apply the fields to the groups. Also you can set the groups to align below or beside each other. Also you can create pages and apply these groups to a page. Then you will have tabs. I created an application of 13 forms. A list of checkboxes will open one or more forms to be entered. I use an ajax event for that. Works great (in this situation).
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development /


        • #5
          Turn fields on/off in forms by variables

          Thanks for your comments.

          Ok, after a long anoying search / trial&error I figured it out, how one can turn off specific fields also in form grids dynamically. Circumventing the "lame" macro sc_field_display:

          Given that SC also canīt handle variables in Macros (why?) I extracted the functions directly from the sourcecode.

          // Turn field "anyfield" off
          $setfield = "anyfield";
          $this->nmgp_cmp_hidden["".$setfield."_"] = "off";
          $this->NM_ajax_info['fieldDisplay'][''.$setfield.'_'] = 'off';

          // Turn field "anyfield" on
          $setfield = "anyfield";
          $this->nmgp_cmp_hidden["".$setfield."_"] = "on";
          $this->NM_ajax_info['fieldDisplay'][''.$setfield.'_'] = 'on';

          Now itīs possible to dynamically change the value for $setfield and turn arbitrary fields on/off.
          BUT you have to define all fields as visible first in the "Fields Configuration" and hide unwanted fields (programmatically) as default afterwards, otherwise SC doesnīt want to pack "not shown fields" into the sourcecode then.