0

1から25のような値を持ち、マトリックス/グリッド方式で順序付けられた単純なhtmlテーブルをグリッドで作成したいと思います。そのグリッドをjqueryuidatetimecontrolのような方法で表示したいと思います。

@for(int i =0;i<5;i++){ for(int j=0;j<5;j++){
<input type="button" id="foo">
if(j==4){
<br/>

}

}

次に、上記のコードをエディターテンプレートとして使用し、テキストボックスに添付します。

ヘルプポインタは大歓迎です。

よろしく

ビラル

}

4

1 に答える 1

0

このようなもの: ?(手書き - 未テスト)

モデル:

public class MyModel
{
    [UIHint("MyCustomEditorTemplateType")]
    public int MyField { get; set; }
}

意見:

@model MyModel
@Html.EditorFor(m => m.MyField)

エディタ テンプレート:

@model string

@Html.TextBoxFor(m => m, new { @class = "forpopupcontrol" })
<div id="@(string.Format("{0}_container", Html.IdFor(m => m)))" style="display:none">
    @* code build table here *@
</div>

JS:

<script>
    $(function()
    {
        $('.forpopupcontrol').focus(function()
        {
            $('#' + $(this).attr('id') + '_Container').show();
        }).blur(function()
        {                
            $('#' + $(this).attr('id') + '_Container').hide();
        });
    }        
</script>
于 2012-09-03T18:57:42.603 に答える