在MVC中的Fly上映射数据 [英] Mapping data on the Fly in MVC

查看:85
本文介绍了在MVC中的Fly上映射数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是mvc5的新手,我正在尝试编写一个简单的地图应用程序。目前,工作流程的工作原理如下:



i。 textarea1中标识符列表中的用户typle

ii。用户点击按钮。

iii。控制器查询数据库映射表。

iv。结果列在textarea2。



我有这个非常有效,但我想知道我是否可以完全删除按钮点击并做飞行中映射ala谷歌翻译。



我已经用Google搜索了但是示例似乎总是涉及用户点击下拉列表等内容...而且我正在努力寻找相关的文章。



我们非常感谢任何帮助。谢谢。

Hi,

I'm a complete newbie to mvc5 and am trying to write a simple mapping application. At the moment, the workflow works as follows:

i. user typle in a list of identifiers in textarea1
ii. user click on a button.
iii. the controller queries the database mapping table.
iv. the result is listed in textarea2.

I have this pretty much working but am wondering if i can remove the button click altogether and do the mapping "on the fly" ala google translate.

I've googled around but examples always seem to involve the user clicking on things like drop down lists etc... and am struggling with finding relevent articles.

Any help would be much appreciated. Thanks.

推荐答案

你需要处理你的模糊事件或你改变的事件(如果是后者,有人停止打字的时间计时器)然后解雇事件。非常简单,如果你必须这样做。我觉得有一个按钮就好了。我只是按按按钮,而不是动态按钮。



你可以使用Chrome查看谷歌的代码看看他们是怎么做到的。右键单击并选择检查元素,虽然赔率是,它有一个id,而其他地方的代码会附加事件。
You need to handle your blur event or your changed event ( if the latter, with a timer to time when someone has stopped typing ) and then fire your event. Pretty straightforward, if you must do that. I think having a button is fine. I'd just make it so that 'enter' pushes the button, instead of doing it on the fly.

You can use Chrome to view Google's code if you want to see how they do it. Right click and choose 'inspect element', although odds are, it has an id, and code elsewhere attaches events to it.


这篇关于在MVC中的Fly上映射数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆