API documentation - Area 2 grid

Config Options Example Result

# Class: emlArea2Grid

Convert an specified screen area (subfile) to grid.

## Config Options

Config Options Top
| pVts (pointer) (required) Pointer to the virtual terminal
| optionStartLine (number) (required for right-click menu) First line number for option description. Ex. line number for following text: 'Type options, press Enter'.
| optionEndLine (number) Last line number for option description. (default to optionStartLine)
| alternativeOptions (string) (optional) The system will alway search for digits option values (ex. 2=Change, etc.) With this option, you can specify alternative options (ex. P=Print). Ex. "A, B, C". String seperated with comma.
| rightClickMenu (array) Array with right click menu for the grid (default to ''). Each element (object) `Id (string)` (required) Id (option) for right click menu item. `Text (string)` (required) Text for right click menu item. `Breakout (string)` (optional) Function from breakout javascript file. Specified in the config.xml document `Icon (string)` (optional) A path to the icon Ex.
       rightClickMenu:[+
         {"1","Create","","/images/icons/create.png"}+
        ,{"2","Change","","/images/icnos/change.png"}+
        ,{"5","Display","","/images/icons/display.png"}+
        ,{"9","Google map","googleMap","/images/icons/google.png"}+
       ]
| moreOptionKey (string) Function key for more options. ex. F23 (default to ' ') Will be pressed to find more options.
| optionFieldKey (string) Function key for executing options. (default to 'ENTER') Will be pressed using right click menu.
| columnHeaderStartLine (number) (required for grid) First line number for column header
| columnHeaderEndLine (number) Last line number for column header (default to columnHeaderStart)
| columns (array) (optional) If not specified, system will try to find the columns separated by blanks. But if the subfile is empty, the system can have difficalities finding the columns.
| columnHeader (array) (optional) Title for the columns
| extraColumns (array) Array with extra columns for the grid (default to ''). Each element (object) `title (string)` (optional) Column header title. (default to '') `width (number)` (optional) The column width in pixels. (default to 100) `xtype (string)` (optional) Type of object added to each row in the grid. At the moment just 'button' is supported. (default to 'button'). `text (string)` (optional) Text / title for the xtype. (default to ''). `columnNumber (number)` (optional) Column number. 1=First column, etc. If zero, the column is added as last column (default to 0). `optionValue (string)` (optional) The value will be inserted into the option field, and ENTER is pressed, when clicking on the xtype. `breakout (string)` (optional) A breakout javascript function. Ex. function() { alert('hello world') } -or IceCap.sample.extraColumn - this function is specified in the javascript file specified in the "clientScriptPath" tag in the icecap-config.xml file. The function is called with "text" and row data as paramenter. Look at "/icecap/scripts/breakouts.js" for a example. This parameter is only used, if "optionValue" not specified. The example below will add two extra columns at the end. The first column with title "Send email" and with a button in each row. When clicking the button "E" will be inserted into the option field and ENTER is pressed. The second column with title "Hello" and with a button in each row. When clicking the button a alert box with text "Hello world" is displayed. Ex.
       extraColumns:[{+
         "title":"Send email"+
         ,"width":70+
         ,"xtype":"button"+
         ,"text":"Email"+
         ,"optionValue":"E"+
        },{+
         "title":"Hello world"+
         ,"width":70+
         ,"xtype":"button"+
         ,"text":"Hello"+
         ,"breakout":"function() { alert(''Hello world'') }"+
       }]'
| quickOptionLine (number) (optional) If specified an extra line is added at the top of the grid, for quick entering of option and key field(s)
| subfileDataStartLine (number) (required for grid) First line number for subfile data, typical just after columnHeaderEndLine
| subfileDataEndLine (number) Last line number for subfile data (default to subfileDataStartLine)
| subfileEndLine (number) Line number for subfile end text. ex. More... or Bottom (default to subfileDataEndLine + 1)
| subfileEndColumn (number) Column number for subfile end text. ex. More... or Bottom (default to 73)
| subfileMoreText (string) Text for more subfile pages. (default to More...). If this text is found in subfileEndLine and column, ROLLDOWN is valid
| subfileBottomText (string) Text for last subfile page. (default to Bottom). If this text is found subfileEndLine and column, ROLLDOWN is NOT valid
| subfilePages (number) Number of subfile pages to convert to grid (default to 1).
| showOptionField (boolean) Show column with option field (default to false).
| optionFieldColumn (number) (optional) If not specified, system will try to find the column number for option field. But it is not possible, if the subfile is empty.
| optionFieldLength (number) (optional) If not specified, system will try to find the length off the option field. But it is not possible, if the subfile is empty. (default to 1).
| toolbar (boolean) Show toolbar over the grid (default to true). If true, system will automatic add 'previous' -and 'next page', if toolbarButtons is not specified.
| toolbarButtons (array) Array with buttons to add the toolbar (default to ''). Each element (object) `Text (string)` (required) Text for the button. `Function key (string)` (required) Function key to simulate, when button is pressed. Valid values: ENTER, F1-F24, ROLLUP, ROLLDOWN or PRINT `Icon class (string)` (optional) A CSS class name for the icon Ex.
       toolbarButtons:[+
         {"Exit","F3"}+
        ,{"Previous page","ROLLDOWN"}+
        ,{"Next page","ROLLUP"}+
        ,{"Refresh","F5"}+
       ]
| toolbarFields (array) Array with fields for the toolbar (default to ''). Each element (object) `Type (string)` (required) Field type, ex.'textField' or 'IceCap.Field'. `Line (number)` (required) Line number for the field, `Label (string)` (required) Label string to search for in line number `ContentLocation (string)` (required) Location of the input field seen from the label. Valid values: north, east, south or west Ex.
       toolbarFields:[+
         {"textFieldWithInlineLabel",4,"Start with","east"}+
         ,{"textField",5,"Customer","east"}+
       ]
| bottomKeys (array) (optional) Array with f-keys to keep in the bottom. If option 'toolbarButtons' is left blank, the rest of the f-keys are automatic move to top toolbar, if option 'toolbar' is set to 'true'. default to (["F3", "F12"]).
| defaultOption (string) (optional) string of option, which will become default option. Ex. "2,5,1"
| ExtJs (mixed) (optional) All ExtJs config options (version 2.3) for a gridpanel. Click here to view the ExtJs API documentation

## Example

Example Top
    emlAddMetaField ('{+
       xtype:"tabpanel",+
       x:10,+
       y:10,+
       width:950,+
       height:650,+
       activeTab: 0,+
       labelWidth: 150,+
       defaults: {bodyStyle:"padding:10px"},+
       items: [{ +
         title:"Work with Spooled Files"+
         ,xtype:"panel"+
         ,x:14+
         ,y:35+
         ,width:800+
         ,height:580+
         ,border:false+
         ,buttonAlign:"left"+
         ,items:['+
           emlArea2Grid(
             pVts
             :'optionStartLine:3+
              ,optionEndLine:5+
              ,moreOptionKey:""+
              ,columnHeaderStartLine:8+
              ,columnHeaderEndLine:9+
              ,columns:[2, 7, 19, 31, 43, 55, 61, 70, 76]+
              ,columnHeader:["Option","","","","","Status"]+
              ,subfileDataStartLine:10+
              ,subfileDataEndLine:18+
              ,subfileEndLine:19+
              ,subfileEndColumn:74+
              ,subfileMoreText:"More..."+
              ,subfileBottomText:"Bottom"+
              ,subfilePages:2+
              ,toolbar:true+
              ,toolbarButtons:[+
                {"Exit","F3"}+
                ,{"Previous page","ROLLDOWN"}+
                ,{"Next page","ROLLUP"}+
                ,{"Refresh","F5"}+
              ]+
              ,toolbarFields:[+
                {"textFieldWithInlineLabel",4,"Start with","east"}+
                ,{"textField",5,"Customer","east"}+
              ]+
              ,showOptionField:true+
              ,optionFieldColumn:1'
           )+
           ...
        ']+
      ']+
     }');

## Result

Result Top