weixin_33708432 2016-08-04 16:55 采纳率: 0%
浏览 16

在视图内部更新模型

I've been working on a photography page for a while now. Now I've tried to create a page on which user will upload photos to database.

I wanted to give the user an option of selecting photo categories on the create/upload page using checkboxes. I wanted to use a viewmodel with list of categoryview models which would represent the checkboxes.

Now the tricky part that i need some help with is how do I allow user to dynamically add new categories (if he needs to) on the same page. So how would i add new values into the list of categories on view.

Only thing that comes to my mind is to create an ajax post that would call a method that would create the new category in the database. Then i could append a new checkbox representing that category, But then i do not know how i would send that category in the list of categories in viewmodel without refreshing current page. Is this even possible?

If any1 has any ideas how to start on this I would be grateful.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度