JTable Plugin - Drop-down list not showing

I am using JTable plugin with JSP and Struts.

Basically, this is what I trying to do:

The table must have two columns, Model and ModelYear.

When I click “Add new record” in the popup input page there must be a dropdown list for Model and dropdown list for ModelYear.

The Model Year dropdown is cascading meaning that when user selects Model from Model dropdown an Ajax call is made to the server and the Model Years for that Selected Model are send back via JSON and its displayed in ModelYear dropdown (Basic Cascade).

Eventually after I code it when I click save the JTable createAction is invoked and the Model and selected Model year is saved on the server via struts action.
I have been working on this successfully been able to send and receive JSON requests from the client to server via the ListAction.

The problem is when I click the “Add new record” button the Input Popup page does not have my dropdown lists Model and ModerYear, it appears to only have the Model and Modelyear fields from the Table as inputs.

My goal is to see only the two dropdowns so I can add a new record. I will work on the edit record functionality later. Here is my JTable code:

$(document).ready(function() {
    $('#ModelMYContainer').jtable({
        title : 'ModelMY Table',
        actions : {
            listAction : 'listITModelMY.do',
            createAction : 'createAction',
            updateAction : 'updateAction',
            deleteAction : 'deleteAction'
        },

        fields : {
            model : {
                title : 'Model',
                options: 'getModelList.do',
                list: false
            },
            modelyear: {
                title: 'Model Year',
                dependsOn: 'model', 
                options: function (data) {
                    if (data.source == 'list') {
                         return 'getModelYearList.do';
                    }

                    return 'getModelYearList.do=' + data.dependedValues.ModelId;
                },
                list: false
            },
            model : {
                title : 'Model',
                width : '10%',
                edit : true
            },
            modelyear : {
                title : 'Model Year',
                width : '10%',
                edit : true
            }
        }
    });
    $('#ModelMYContainer').jtable('load');
});

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.