Closed MatsiukMykola closed 6 months ago
I can not determine the specific reason, you can set a program breakpoint here to debug, see whether the code is running normally.
i tried add some event logic, and this requires to set 'id' property for fields because that used to identify field. If not setup id
when copypaste to editor online (to educate logic and properties) editor autogenerate id. So I little confuse id require or not?
async def get_form_item(
self, request: Request, modelfield: ModelField, action: CrudEnum
) -> Union[FormItem, SchemaNode, None]:
item = await super().get_form_item(request, modelfield, action)
if item.name == Trigger.event.key: # noqa
item.id = item.name
if item.name == Trigger.target.key: # noqa
item.id = item.name # noqa
item.selectFirst = True # noqa
item.clearValueOnHidden = True # noqa
item.visibleOn = '${event!="STANDALONE"}'
item.source = {
"url": "TriggerAdmin/target_items/list?tet=${event}",
"sendOn": 'event'
}
return item
maybe just autosetup id field at runtime? i newbe, maybe I'm not right, what you think about this ?
Are you suggesting that the fastapi-amis-admin source code set an id for form items by default?
because when insert to editor id autocreate, example:
"id": "u:57b6fb4bc910",
The default id is not generated for two main reasons:
you're right, I think the demo requires a good extending I will help with this when being possible, I like you library, but so many dark places)))
educate event system in amis, but this require id, I do:
but why just not assign a name at runtime? are there any reasons?