Add title to kendo ui grid

别等时光非礼了梦想. 提交于 2019-12-13 01:07:00

问题


After researching on the web, i´m facing a problem on adding a title into my grid, so my code is:

.html file:

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

.js file:

$("#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)

I think i have posted the necessary code to show my problem, so my question is, what am i missing here?. any help? thanks.

来源:https://stackoverflow.com/questions/28498234/add-title-to-kendo-ui-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!