// Student form definitions ------------------------------------------------

var dormComboBoxSearch = new Ext.form.ComboBox({
    store: dormDataArr,
    mode: 'local',
    valueField: 'id',
    displayField: 'editid',
    fieldLabel: 'POD',
    name: 'dormName',
    typeAhead: true,
    triggerAction: 'all'
});

function clickSearch(){
    dh.overwrite( 'theMsgtext0', 'Report running...' );
    dh.overwrite( 'theMsgtext1', '' );
    searchStudents = studentSearchForm.getForm().getValues().studentName;
    searchStudentID = studentSearchForm.getForm().getValues().studentid;
    searchDorm = studentSearchForm.getForm().getValues().dormName;
    studentDataArr.baseParams = {
        name:searchStudents,
        studentid:searchStudentID,
        dormid:searchDorm
    };
    studentDataArr.load();
    dh.overwrite( 'theMsgtext1', 'clickSearch exist.' );
}

var studentSearchForm = new Ext.FormPanel({
    title:'Search Job',
    autoWidth : true,
    labelWidth: 100,
    border: false,
    frame: true,
    items:[{
        layout:'form',
        defaults: {
            width: 300
        },
        defaultType: 'textfield',
        items: [
        {
            fieldLabel: 'Job No',
            name: 'studentName'
        },{
            fieldLabel: 'Voy No',
            name: 'studentid'
        },
        dormComboBoxSearch
        ]
    }],
    buttons: [{
        text: 'Search',
        listeners:{
            click: clickSearch
        }
    },{
        text: 'Reset',
        handler: function(){
            studentSearchForm.getForm().reset();
            dh.overwrite( 'theMsgtext0', '&nbsp;' );
            dh.overwrite( 'theMsgtext1', '&nbsp;' );
        }
    }]
});

// eof
