小编rjd*_*llo的帖子

如何使用tagit与淘汰赛

我在我的代码中使用http://aehlke.github.com/tag-it/如何与viewmodel绑定

HTML

<ul data-bind='jqueryui: "tagit",foreach: Tags' >
            <li class="tagit-choice ui-widget-content ui-state-default ui-corner-all" data-bind='with: $data'>
                <span class="tagit-label" data-bind='text: $data'></span>
                <a class="tagit-close">
                    <span class="text-icon">&times;</span>
                    <span class="ui-icon ui-icon-close"></span>
                </a>
                <input type="hidden" name="item[tags][]" data-bind='value: $data'  style="display: none;">
            </li>
            </ul>
Run Code Online (Sandbox Code Playgroud)

Js代码

function AppViewModel() {
var self = this;

function Tag(data) {
            this.Name = data;
        }

self.Tags = ko.observableArray([
            new Tag('red'),
            new Tag('blue'),
            new Tag('green')
        ]);
 }

// Activates knockout.js
ko.applyBindings(new AppViewModel());
Run Code Online (Sandbox Code Playgroud)

提前感谢你的帮助!

tag-it knockout-mapping-plugin knockout.js

5
推荐指数
2
解决办法
4914
查看次数

从HttpPostedFileBase对象读取Excel文件数据

上传的Excel文件是在HttpPostedFileBase对象中

HttpPostedFileBase hpf = Request.Files ["ExcelFileeUploader"];

想要从此对象读取Excel数据.谢谢.

excel

4
推荐指数
1
解决办法
8150
查看次数