Javascript 剑道UI不使用Meteor?
我正在尝试在Meteor中获得一个简单的多选工作。在检查了大约20个不同的UI库之后,我认为剑道UI看起来最好 我环顾四周,发现他们已经安装了Meteor软件包,可以(据说)轻松地在Meteor中使用剑道UI。以下是我在Meteor中使用剑道UI尝试通过MultiSelect获得Hello World的步骤:Javascript 剑道UI不使用Meteor?,javascript,jquery,meteor,kendo-ui,Javascript,Jquery,Meteor,Kendo Ui,我正在尝试在Meteor中获得一个简单的多选工作。在检查了大约20个不同的UI库之后,我认为剑道UI看起来最好 我环顾四周,发现他们已经安装了Meteor软件包,可以(据说)轻松地在Meteor中使用剑道UI。以下是我在Meteor中使用剑道UI尝试通过MultiSelect获得Hello World的步骤: meteor create FindMeFood meteor add telerik:kendo-ui-core-fiori-theme 然后我修改了FindMeFood.html:
meteor create FindMeFood
meteor add telerik:kendo-ui-core-fiori-theme
然后我修改了FindMeFood.html
:
<head>
<title>FindMeFood</title>
</head>
<body>
<label for="where">Where</label>
<select id="where" multiple="multiple" data-placeholder="Select where...">
<option>McDonalds</option>
<option>Burger King</option>
<option>Wendy's</option>
<option>Five Guys</option>
<option>KFC</option>
<option>Taco Bell</option>
<option>Pizza Hut</option>
<option>Papa Johns</option>
</select>
</body>
绝对什么也没发生。当我启动Meteor并访问页面时,我得到了一个标准的多选择框。Meteor is client方法可能在客户端呈现HTML之前运行 试着这样做,效果很好:
.html
文件中引入命名模板:
<head>
<title>FindMeFood</title>
</head>
<body>
{{> kendo}}
</body>
<template name="kendo">
<label for="where">Where</label>
<select id="where" multiple="multiple" data-placeholder="Select where...">
<option>McDonalds</option>
<option>Burger King</option>
<option>Wendy's</option>
<option>Five Guys</option>
<option>KFC</option>
<option>Taco Bell</option>
<option>Pizza Hut</option>
<option>Papa Johns</option>
</select>
</template>
meteor is客户端方法可能在客户端呈现HTML之前运行 试着这样做,效果很好:
.html
文件中引入命名模板:
<head>
<title>FindMeFood</title>
</head>
<body>
{{> kendo}}
</body>
<template name="kendo">
<label for="where">Where</label>
<select id="where" multiple="multiple" data-placeholder="Select where...">
<option>McDonalds</option>
<option>Burger King</option>
<option>Wendy's</option>
<option>Five Guys</option>
<option>KFC</option>
<option>Taco Bell</option>
<option>Pizza Hut</option>
<option>Papa Johns</option>
</select>
</template>
meteor is客户端方法可能在客户端呈现HTML之前运行 试着这样做,效果很好:
.html
文件中引入命名模板:
<head>
<title>FindMeFood</title>
</head>
<body>
{{> kendo}}
</body>
<template name="kendo">
<label for="where">Where</label>
<select id="where" multiple="multiple" data-placeholder="Select where...">
<option>McDonalds</option>
<option>Burger King</option>
<option>Wendy's</option>
<option>Five Guys</option>
<option>KFC</option>
<option>Taco Bell</option>
<option>Pizza Hut</option>
<option>Papa Johns</option>
</select>
</template>
meteor is客户端方法可能在客户端呈现HTML之前运行 试着这样做,效果很好:
.html
文件中引入命名模板:
<head>
<title>FindMeFood</title>
</head>
<body>
{{> kendo}}
</body>
<template name="kendo">
<label for="where">Where</label>
<select id="where" multiple="multiple" data-placeholder="Select where...">
<option>McDonalds</option>
<option>Burger King</option>
<option>Wendy's</option>
<option>Five Guys</option>
<option>KFC</option>
<option>Taco Bell</option>
<option>Pizza Hut</option>
<option>Papa Johns</option>
</select>
</template>
如果你不想在这一点上搞砸,就用 在meteor 1.0.4版或>
if(Meteor.isClient){
Template.body.onRendered(function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
})
}
流星1.0.4或更低
if(Meteor.isClient){
Template.body.rendered = function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
}
}
为什么使用呈现函数()
?使用呈现函数,可以确保代码在DOM准备就绪时运行,在本例中,选择如果此时不想弄乱,只需使用
在meteor 1.0.4版或>
if(Meteor.isClient){
Template.body.onRendered(function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
})
}
流星1.0.4或更低
if(Meteor.isClient){
Template.body.rendered = function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
}
}
为什么使用呈现函数()
?使用呈现函数,可以确保代码在DOM准备就绪时运行,在本例中,选择如果此时不想弄乱,只需使用
在meteor 1.0.4版或>
if(Meteor.isClient){
Template.body.onRendered(function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
})
}
流星1.0.4或更低
if(Meteor.isClient){
Template.body.rendered = function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
}
}
为什么使用呈现函数()
?使用呈现函数,可以确保代码在DOM准备就绪时运行,在本例中,选择如果此时不想弄乱,只需使用
在meteor 1.0.4版或>
if(Meteor.isClient){
Template.body.onRendered(function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
})
}
流星1.0.4或更低
if(Meteor.isClient){
Template.body.rendered = function(){
$("#where").kendoMultiSelect().data("kendoMultiSelect");
}
}
为什么使用呈现函数()
?使用呈现函数,您可以确保代码在DOM准备就绪时运行,在本例中是#where select
对不起,我整个星期都在忙于我的日常工作,直到现在才有机会返回到此项目(是的,周末)。无论如何,您的解决方案似乎是两者中比较简单的一种,不需要我创建只使用一次的模板。所以我把它标为接受。对不起,我整个星期都在忙我的日常工作,直到现在才有机会回到这个次要项目(对周末来说是的)。无论如何,您的解决方案似乎是两者中比较简单的一种,不需要我创建只使用一次的模板。所以我把它标为接受。对不起,我整个星期都在忙我的日常工作,直到现在才有机会回到这个次要项目(对周末来说是的)。无论如何,您的解决方案似乎是两者中比较简单的一种,不需要我创建只使用一次的模板。所以我把它标为接受。对不起,我整个星期都在忙我的日常工作,直到现在才有机会回到这个次要项目(对周末来说是的)。无论如何,您的解决方案似乎是两者中比较简单的一种,不需要我创建只使用一次的模板。所以我把它标记为接受。这似乎是一个有效的解决方案,但涉及到创建一个我只会使用一次的模板,所以我选择了另一个建议的解决方案。不过,感谢你的努力。谢谢我同意另一个解决方案更一般。这似乎是一个有效的解决方案,但涉及到创建一个我只会使用一次的模板,所以我选择了另一个建议的解决方案。不过,感谢你的努力。谢谢我同意另一个解决方案更一般。这似乎是一个有效的解决方案,但涉及到创建一个我只会使用一次的模板,所以我选择了另一个建议的解决方案。不过,感谢你的努力。谢谢我同意另一个解决方案更一般。这似乎是一个有效的解决方案,但涉及到创建一个我只会使用一次的模板,所以我选择了另一个建议的解决方案。不过,感谢你的努力。谢谢我同意另一种解决办法更为普遍。