0

我已经看到一个 grails 域类有这样的定义:

static formLayout =
    [   title:"New Patient Patient",
        layout: "custom",
        autoHeight:true,
        items:
        [
            [
                layout: 'column',
                labelWidth: 135,
                items:
                [[
                    columnWidth: 0.5,
                    layout: 'form',
                    items:["patientNo", "dob","surName"]
                ],[
                    columnWidth: 0.5,
                    layout: 'form',
                    items:["responsibleDoctor","givenName","sex.value"]
                ]]
            ],
...
]

我想知道的是如何从 extjs 文件或控制器文件中使用/调用它,使其显示为表单。

4

1 回答 1

1

This is not a common approach to have javaScript parameters defined in Domain classes for the consumption of the views.

However, Assuming that you are looking at a code base that applied such approach, if I am not mistaken the view that is consuming them is sending an ajax call to a controller and reads these values as JSON. I am not much familiar with extJs, but it should be able to consume parameters as JSON. For example, Ext.create has option url that hits the external source. If you are looking at a code base that is using this approach you should be able find the view and controller that is delivering and consuming it.

于 2013-09-24T14:04:37.207 回答