Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Here is my combo box I want to put 3 values in this combo box and have it so when a value is selected it calls a method in my controller class.
Could I get a example on how to call my method in a different class from a value selected in the combo box

C#
{
            xtype: 'label',
            style: 'margin-right:5px;margin-left:3px',
            text: 'Format'            
        }, {
            id: 'FormatId',
            xtype: 'combo',
            width: 140,
            displayField: 'Text',
            valueField: 'Value',
            emptyText: 'Default',
            hiddenName: 'FormatId',
            forceSelection: true,
            triggerAction: 'all',
            mode: 'local',

//Controller class
[Authorize(Roles = RoleAdmin + "," + RoleBilling + "," + RoleBillingDocument)]
        private ActionResult TripLogSpreadsheet(List<usp_TripLogResult> list, object[] filterStrs) 
        {
            const int colRideDate = 0;
            const int colJobNum = 1;
            const int colMemberName = 2;
            const int colAWS = 3;
            const int colRNS = 4;
                {
                    ICell hCell = hRow.CreateCell(colWaitTime, CellType.NUMERIC);
                    hCell.CellStyle = template_row.GetCell(colWaitTime).CellStyle;
                    hCell.SetCellValue(record.WaitTime);
                }
                {
                    ICell hCell = hRow.CreateCell(colBilledAmount, CellType.STRING);
                    hCell.CellStyle = template_row.GetCell(colBilledAmount).CellStyle;
                    hCell.SetCellValue(String.Empty);
                }
                {
                    ICell hCell = hRow.CreateCell(colAttendantsQty, CellType.STRING);
                    hCell.CellStyle = template_row.GetCell(colAttendantsQty).CellStyle;
                    hCell.SetCellValue(!String.IsNullOrEmpty(record.AttendantsQty) ? record.AttendantsQty : String.Empty);                    
                }
                {
                    ICell hCell = hRow.CreateCell(colSignature, CellType.STRING);
                    hCell.CellStyle = template_row.GetCell(colSignature).CellStyle;
                    hCell.SetCellValue(String.Empty);
                }
            sheet.ForceFormulaRecalculation = true;
            var memoryStream = new MemoryStream();
            wk.Write(memoryStream);

            return File(memoryStream.ToArray(), "application/vnd.ms-excel", "trip_log.xls");
        }
Posted
Comments
TheBigBearNow 23-Nov-15 17:17pm    
I have created this Model and Store - i believe this will work with combo box Store:formatStyleSheet ?
Ext.define('formatStyleSheetModel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'value', type: 'int' },
{ name: 'spreadsheet', type: 'string' },
{ name: 'format', type: 'string' }
]
});

var formatStore = new Ext.data.Store({
model: 'formatStyleSheetModel',
data: [
{ value: 0, spreadsheet: 'Logisticare', format: 'Logisticare', defaultValue: true },
{ value: 1, spreadsheet: 'MTM', format: 'MTM' },
{ value: 2, spreadsheet: 'Access2Care', format: 'Access2Care'}
]
});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900