Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

override grid settings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    override grid settings

    Situation: a grid with a row expander that has linked grids.
    for 2 of these linked grids i use the same grid only apply another filter.
    I could choose to use 2 different grids but i like to have as few as possible and use them dynamicly.
    I use the override grid settings for changing the filter and that works excellent

    Code:
    DBF.filter = "Type = \"Poortwachter\".AND.Ziekte_Percentage=0"
    so far it works ok.
    Also i want to hide a few columns in one of these grids using the override settings. I tried several options/notations
    like:

    Code:
    field_info[6].Column.Hide = .t.
    field_info[6]Column.Hide = .t.
    field_info6Column.Hide = .t.
    field_info6.Column.Hide = .t.
    also all with tmpl. before it but it doesnt work

    Also used the existing property like
    Code:
    with field_info[6]
    	.Column.Hide = .t.
    end with
    somebody struggled with this?

    #2
    Re: override grid settings

    In the onGridExecute event, use this:

    Code:
    e.tmpl.flagMustRecalculateGridLayoutAndControls = .t.
    e.tmpl.field_info[2].Column.Hide = .t.
    I didn't think you had to use the flagMust... etc. mainly because I haven't really seen it mentioned, but in my test grid it was needed. Look here for more information regarding the format of the Grid... e.g. Form

    http://wiki.alphasoftware.com/How+to...outAndControls

    Comment


      #3
      Re: override grid settings

      Hi David,

      thanks for the help but i've seen this solution but i think it is not what i'm looking for. The problem is that i have to put that in the 'destination' grid. So to have it dynamicly i also need to send some vars because i do not always want to hide -say- column 2. If i can get it to work in the grid override settings i can use 1 grid several times and that it has several looks and i don't need to worry about sending the vars.
      I if can't get it to work with override i'm going to try your suggested way. I guess then i've to "prepare" the grid with probably a select statement to change layout on run time, but i hope it can be easier (or am i thinking totally wrong?)

      Comment


        #4
        Re: override grid settings

        I'm not convinced this will work... it seems to be working but for some reason I'm not 100% sure of it. This is a grid with a row expander to open a child grid.

        In the parent grid, in the Xbasic Function Declarations I have this function

        Code:
        function setHideCols as c (e as p)
             Dim cp as c
             cp = Left(e._currentRowDataNew.cover_period,1)
             e.session.colsToHide=cp
        end function
        cp means nothing - it's just picking up data from the grid... the data is "1 day", "2 day" etc. so I'm just grabbing the 1 or 2 to pass along to the child grid, telling it which column to hide.
        And I'm setting a session variable to use in the child grid.

        In the Parent Grid, in the Javascript System Events, in afterRowExpand, I have

        Code:
        //place this Javascript in your code, and then reference the rowNum variable.
        var rowNum = {Grid.Object}._selectedRow;
        {grid.Object}.ajaxCallback('G',rowNum,'setHideCols','','_getData=true');
        In the Child Grid, Events, OnGridExecute, I have

        Code:
        Dim x as n
        x = e.rv.Session.colsToHide
        
        e.tmpl.flagMustRecalculateGridLayoutAndControls = .t.
        e.tmpl.field_info[x].Column.Hide = .t.
        The results should be that the 1st or 2nd column should be hidden depending on which row of the parent grid you expanded - because the data is either "1 Day" or "2 Day" in my data.
        I've testing this with alerts in place to show me what's going on. It works. Taking the alerts out it doesn't work. I think it's a timing issue, but not sure yet.

        Comment


          #5
          Re: override grid settings

          I can get this to work if, on the parent grid, I select the row first, then expand it. Works every time. I've tried the ajax callback in the onRowSelect event, and the event does fire before the row gets expanded, but it doesn't work. Any ideas?

          Comment


            #6
            Re: override grid settings

            Hi David
            I figured it out. Thanks anyway for your effort and showing anotherway.

            With this Alpha5 feature i can work very flexible. I created a (child) grid with all columns i need. In a parent grid I link to the child grid with the use of the row expander. I want to have several different views based on the same grid (only displaying other columns) .
            In the override grid settings i hide the columns i don't want to see in a particular view (see attachement).
            Like:

            Code:
            DBF.filter = "Type = \"Poortwachter\".AND.Ziekte_Percentage=0"     'override basic filter for this particular view
            field_info[6].Column.Hide = .t.     'hide column 6
            field_info[10].Column.Hide = .t.
            field_info[11].Column.Hide = .t.
            field_info[12].Column.Hide = .t.
            field_info[13].Column.Hide = .t.
            summary.Suppress= .t.               'column 13 has a summary section so this also has to be hidden
            flagMustRecalcGridLayout = .t.      'make sure grid is adjusted
            It was just finding the right syntax
            Attached Files

            Comment


              #7
              Re: override grid settings

              Hi marc,

              Thanks, this was what i needed just right now :-)

              Only one thing, did you ever try to show collumns which are initially hidden?
              It work for me, only the collumn header doesn't render properly

              In my example the override settings are:

              HasQuickSearch = .f.
              field_info[7].Column.Hide = .t.
              field_info[8].Column.Hide = .f.
              field_info[8].Column.Header = "Contract Relatie"
              field_info[8].Column.Sort = "kontrakt.KONTRAKT_huurder"
              field_info[8].Column.InLineStyle = "vertical-align: top;"
              flagMustRecalcGridLayout = .t. 'make sure grid is adjusted

              but in the grid as collumn header {gridColumnTitle.KONTRAKT_HUURDER} is rendered. Rest works like a charm.

              Of course i can stick with showing always all fields and hide when needed, but that is a little waist of effort because in 95% of the cases field 7 has to be shown and 8 must be hidden

              UPDATE: if I use flagMustRecalculateAllProperties = .t. I get slightly better result: the collumn header renders the database field name: KONTRAKT_huurder, but of course this is not good enough...


              thanks,
              Last edited by cptutrecht; 03-29-2012, 06:09 AM.
              Ger Kurvers
              Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
              Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

              Comment


                #8
                Re: override grid settings

                Found finally also a solution to standard hide fields and show them through overide settings when linking the grid

                Don't use standard show/hide features in grid. Use instead advanced properties tab of the grid and put in a slightly different syntax:

                tmpl.field_info[7].Column.Hide = .t.

                in overide settings on can use then

                field_info[7].Column.Hide = .f. with good results
                Last edited by cptutrecht; 04-25-2012, 06:06 AM.
                Ger Kurvers
                Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
                Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

                Comment


                  #9
                  Re: override grid settings

                  Using the syntax below hides the columns.

                  field_info[N1].Column.Hide = .t.
                  field_info[N2].Column.Hide = .t.
                  flagMustRecalcGridLayout = .t.

                  However, the summary "cells" for each hidden column still show.
                  The net effect is the summary column is shifted to the right, under the wrong column.

                  Anybody found a fix?

                  Comment

                  Working...
                  X