For reference: http://www.axaptapedia.com/index.php?title=Multiple_grid_selections
I wanted to test this out here are the steps to produce with a twist thrown in for Active on the datasource.
- Create a new form, called TestMultiSelect
- copy CustTable to the data source
- under design,
- add a grid,
- on grid copy "Invoice" field group to the grid
- add a button
- on the button select Multiselect = Yes
- add a grid,
- code for the buttons clicked event see Figure 1
- on active code override of the datasource custtable put code for figure 2
- That is it, now you have a multiselect button and a way while form is loaded to check things like should the button be lit up or not in the active method.
1: void clicked() 2: { 3: 4: custTable currentCustTable; 5: ; 6: super(); 7: 8: for (currentCustTable = custTable_ds.getFirst(true) ?
9: custTable_ds.getFirst(true) :
10: custTable_ds.cursor(); currentCustTable; currentCustTable = custTable_ds.getnext())
11: { 12: info(currentCustTable.InvoiceAccount); 13: } 14: 15: }Figure 1
1: public int active()
2: {3: int ret;
4: CustTable currentCustTable; 5: 6: ret = super(); 7: 8: for (currentCustTable = custTable_ds.getFirst(true) ?
9: custTable_ds.getFirst(true) :
10: custTable_ds.cursor(); currentCustTable; currentCustTable = custTable_ds.getnext())
11: { 12: info(currentCustTable.InvoiceAccount); 13: } 14: 15: 16: return ret;
17: }Figure 2
No comments:
Post a Comment