Twitter bootstrap 使用Twitter引导和KnockoutJS对齐

Twitter bootstrap 使用Twitter引导和KnockoutJS对齐,twitter-bootstrap,knockout.js,Twitter Bootstrap,Knockout.js,如何按如下方式对齐复选框列表: 我当前的代码: 引导示例 日历样本 函数MyViewModel(){ szWeekArray=[“1”、“2”、“3”、“4”、“5”、“6”、“7”、“8”、“9”、“10”、“11”、“12”、“13”、“14”、“15”、“16”、“17”、“18”、“19”、“20”、“21”、“22”、“23”、“24”、“25”、“26”、“27”、“28”、“29”、“30”、“31”、“32”、“33”、“34”、“35”、“36”、“37”、“38”、“39

如何按如下方式对齐复选框列表:

我当前的代码:


引导示例
日历样本
函数MyViewModel(){
szWeekArray=[“1”、“2”、“3”、“4”、“5”、“6”、“7”、“8”、“9”、“10”、“11”、“12”、“13”、“14”、“15”、“16”、“17”、“18”、“19”、“20”、“21”、“22”、“23”、“24”、“25”、“26”、“27”、“28”、“29”、“30”、“31”、“32”、“33”、“34”、“35”、“36”、“37”、“38”、“39”、“40”、“41”、“42”、“43”“第44”、“45”、“46”、“47”、“48”、“49”、“50”、“51次”];
this.cal_week=ko.observearray(szWeekArray);
}
应用绑定(新的MyViewModel());

您应该选择首选的方法,并相应地调整视图和视图模型

首先,您的视图模型应该按照以下方式进行更改:

function MyViewModel() {
  var self = this;
  var szWeekArray = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th", "31st", "32nd", "33rd", "34th", "35th", "36th", "37th", "38th", "39th", "40th", "41st", "42nd", "43rd", "44th", "45th", "46th", "47th", "48th", "49th", "50th", "51st"];
  self.cal_week = ko.observableArray(szWeekArray);
  self.cal_week_chunks = ko.computed(function() {
    // Pseudo-code, choose your chunkify method from linked question
    return self.cal_week().chunkify(17);
  });
}
然后绑定到新的
cal\u week\u块
computed
observable以包装内容:



并根据您的意愿设计
(例如使用
内联块
)。

我想您必须混合编码逻辑和CSS。在屏幕中,第一个17项出现在第一列,比如第二列,您必须插入更多的复选框,以此类推。