将标题添加到kendo ui grid

时间:2015-02-13 11:07:34

标签: kendo-ui kendo-grid

在网上研究后,我在向网格添加标题时遇到了问题,所以我的代码是:

.html文件:

<div id="idGridTiposQuartos" class="gridtiposquartos js-var-grid-tipos-quartos"><div id="gridTiposQuartos"></div></div>

.js文件:

$("#idBtnTiposQuarto").click(function()
    {
      $("#idGridTiposQuartos").fadeIn(1000);
      $("#idBtnQuartos").attr("disabled", false);
      $(".k-grid-toolbar", "#gridTiposQuartos").before("<h1>hello</h1>");
      $(".k-grid-toolbar", "#gridTiposQuartos").after("<h1>hello</h1>");

(some more code)

$("#gridTiposQuartos").kendoGrid({
        dataSource: dataSource,   
        pageable: 
        {
          messages: 
          {
            display: "{0} - {1} / {2} items", 
            empty: "0 items",
            page: "Page",
            of: "of {0}", //{0} is total amount of pages
            itemsPerPage: "items per page",
            first: "Go to the first page",
            previous: "Go to the previous page",
            next: "Go to the next page",
            last: "Go to the last page",
            refresh: "Refresh"
          }
        },

        serverPaging: true,
        height: 460,

        toolbar:[{name: "create",text: $varGridQuartosBtnNovoPT},{name: "close",text: "X"}],

        columns:[{ field:"Nome", title: "Nome" },{ field: "Preco", title:"Preço", format: "{0:c}", width: "100px" },

        {command:[{ name: "edit",text:{edit:$varGridQuartosBtnEditarPT,update:$varGridQuartosBtnActualizarPT,cancel:$varGridQuartosBtnCancelarPT}},{ name: "destroy",text:$varGridQuartosBtnApagarPT }],title:"&nbsp;",width: "230px"}],

         editable  : {mode : "popup",

           window : {title: "Editar",}
(the rest of the code)

我想我已经发布了必要的代码来展示我的问题,所以我的问题是,我在这里缺少什么?任何帮助?感谢。

0 个答案:

没有答案