Thread Rating:
  • 328 Vote(s) - 2.66 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RecordGrid 列の表示/非表示について
05-19-2015, 10:25 AM,
#2
RE: RecordGrid 列の表示/非表示について
残念ながら標準でコンテキストメニューで列の表示/非表示を制御するものはないんじゃないでしょうか。

しかし、RecordGridUIにcontext-menu-atメソッドがあります。
このメソッドをオーバーライドすることでコンテキストメニューを改変できます。
ここを実装することで実現できるんではないでしょうか

Code:
{define-class public MyRecordGridUI {inherits SkinnableRecordGridUI}
  
  {constructor public {default ...}
    {construct-super ...}
  }
  
  {method public {context-menu-at x:Distance, y:Distance}:#MenuPane
    let mp:#MenuPane = {super.context-menu-at x, y}
    {mp.add
        {SubMenu label = "表示",
            {MenuAction
                label = "abc",
                {on Action do
                    {dump "abc"}
                }
            },
            {MenuAction
                label = "def",
                {on Action do
                    {dump "def"}
                }
            }
        }
    }
    {mp.add
        {SubMenu label = "非表示",
            {MenuAction
                label = "123",
                {on Action do
                    {dump "123"}
                }
            },
            {MenuAction
                label = "456",
                {on Action do
                    {dump "456"}
                }
            }
        }
    }
    
    {return mp}
  }
  
  
}


{value
    {RecordGrid
        ui-object = {MyRecordGridUI},
        record-source =
            {RecordSet
                {RecordFields
                    {RecordField
                        "First", caption = "First Name", domain = String
                    },
                    {RecordField
                        "Last", caption = "Last Name", domain = String
                    },
                    {RecordField "Age", domain = int}
                },
                {RecordData First = "John", Last = "Smith", Age = 25},
                {RecordData First = "Jane", Last = "Smith", Age = 29},
                {RecordData First = "Jane", Last = "Jones", Age = 28}
            },
        height = 3cm
    }
}



Messages In This Thread
RE: RecordGrid 列の表示/非表示について - by dankom - 05-19-2015, 10:25 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  RecordGrid の行の実際の高さの調べ方 kay 2 3,117 03-01-2016, 06:14 PM
Last Post: kay
  RecordGrid でDropdownList を表示 umemura 10 14,859 06-30-2015, 06:52 PM
Last Post: dyoshida
  RecordGrid のセル単位のフォーカス制御方法 kay 2 3,286 03-06-2015, 06:34 PM
Last Post: kay
  RecordGrid のセルのフォーカス可否制御 kay 2 3,579 03-02-2015, 07:56 PM
Last Post: kay
  RecordGrid の縦のスクロールバー umemura 3 5,154 01-20-2014, 10:38 AM
Last Post: umemura
  RecordGrid のパフォーマンスについて umemura 8 12,787 01-06-2014, 02:34 PM
Last Post: umemura
  RecordGrid の NavigationPanel について umemura 2 5,117 08-23-2011, 08:52 AM
Last Post: c-s
  RecordGrid で オートコンプリート umemura 1 4,744 07-29-2011, 10:58 PM
Last Post: umemura
  RecordGrid での右詰め umemura 3 6,012 07-29-2011, 01:32 PM
Last Post: c-s
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('1224')