Telerik Forums
Kendo UI for jQuery Forum
1 answer
240 views

kendoMaskMaskedTextBox 이벤트를 통해 검도 그리드의 값을 변경하고 싶지만 enter 이벤트 

작동하지 않습니다 어떻게 변환합니까?

{field: "roomNum", title: "Room #", width: "150px", attributes:{style:"text-align:center;"},editor: dateEditor}
 
 function dateEditor(container, options) {
      $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '"/>')
      .appendTo(container)
      .kendoMaskedTextBox({
          change: function(e){
              var model = options.model;
              assignRoom(model);
             console.log('options-->', options);
          }
      });
};

 

var assignRoom = function(obj) {
        angular.forEach($scope.gridSource.data(), function(v, k) {
            if (v.roomNum === obj.roomNum) {
                if (v.rsvDtlsId !== obj.rsvDtlsId) {
                    v.roomNum = "";
                }
            }              
        });
        var idx = 0, delRoom = null;
        angular.forEach($scope.gridModel, function(v, k) {
            if (v.rsvDtlsId === obj.rsvDtlsId) {
                if (obj.roomNum === "") {
                    delRoom = v.roomNum;
                }
 
                v.roomNum = obj.roomNum;
                idx = k;
            }              
        });
 
        angular.forEach($scope.checkedModel.roomNum, function(v, k) {
            if (v === delRoom) {
                $scope.checkedModel.roomNum[k] = "";
            }              
        });
 
 
        angular.forEach($scope.assignModel, function(v, k) {
            if (v.roomNum === $scope.gridModel[idx].roomNum) {
                $scope.checkedModel.roomNum[idx] = v.roomNum;
            }              
        });
         
        $scope.saveEach(obj);
        $scope.$apply();
    };

kendoMaskedTextBox evnet을 통해 검도 그리드의 값을 변경하고 싶습니다. 그러나 엔터 이벤트가 작동하지 않습니다. 어떻게 변환합니까?

{field: "roomNum", title: "Room #", width: "150px", attributes:{style:"text-align:center;"},editor: dateEditor} 

 function dateEditor(container, options) {
      $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '"/>')
      .appendTo(container)
      .kendoMaskedTextBox({
          change: function(e){
              var model = options.model;
              assignRoom(model);
             console.log('options-->', options); 
          }
      }); 
};

kendoMaskedTextBox evnet을 통해 검도 그리드의 값을 변경하고 싶습니다. 그러나 엔터 이벤트가 작동하지 않습니다. 어떻게 변환합니까?

{field: "roomNum", title: "Room #", width: "150px", attributes:{style:"text-align:center;"},editor: dateEditor} 

 function dateEditor(container, options) {
      $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '"/>')
      .appendTo(container)
      .kendoMaskedTextBox({
          change: function(e){
              var model = options.model;
              assignRoom(model);
             console.log('options-->', options); 
          }
      }); 
};

kendoMaskedTextBox evnet을 통해 검도 그리드의 값을 변경하고 싶습니다. 그러나 엔터 이벤트가 작동하지 않습니다. 어떻게 변환합니까?

{field: "roomNum", title: "Room #", width: "150px", attributes:{style:"text-align:center;"},editor: dateEditor} 

 function dateEditor(container, options) {
      $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '"/>')
      .appendTo(container)
      .kendoMaskedTextBox({
          change: function(e){
              var model = options.model;
              assignRoom(model);
             console.log('options-->', options); 
          }
      }); 
};
Georgi
Telerik team
 answered on 18 May 2017
1 answer
1.1K+ views
I'm writing a universal function that will apply a standard context menu to every single grid on our whole site. My problem is, I'm trying to also universally bind the option to export all pages and cannot find any documentation on how to apply it via the saveAsExcel function. Here is my JS function


function Universal_Grid_ContextMenu(grid) {
     
    $("#context-menu").kendoContextMenu({
        target: grid,
        select: function(e) {
            var element = e.item;
            var grid = $(e.target).data("kendoGrid");
            var action = $(element).attr("data-action");
             
            if(action != undefined && grid !=undefined) {
                 
 
                    switch(action) {
                            case "grid_menu_export":
                                grid.bind("excel", function(e) {
                                        e.workbook.allPages = true
                                });
                                 
                                grid.saveAsExcel();
                             
                            break;
                            case "grid_menu_refresh":
                                grid.dataSource.read();
                                grid.refresh();
                            break;
                    }
                     
                 
            }
            console.log();
 
             
        }
    });        
     
}
Jeff
Top achievements
Rank 1
 answered on 18 May 2017
1 answer
1.3K+ views
Currently we have an example of One level hierarchical Grid but i need Multi Level Hierarchical Grid. Please provide me the Link for Demo of Multi Level hierarchical grid. Thank you.

Dimitar
Telerik team
 answered on 18 May 2017
5 answers
405 views
I can't display in a kendo grid the data that I am returning from my Controller as Json Result.


     
  [HttpPost]
  public ActionResult PermitSearch(BptSearchViewModel viewModel)
  {
    var data = appService.SearchPermitInspection(viewModel);
 return Json(data, JsonRequestBehavior.AllowGet);<br>        }


now from my View I am submitting the information using ajax

      @using (Ajax.BeginForm("PermitSearch", "Home", null, new AjaxOptions
      {
            HttpMethod = "post",
            InsertionMode = InsertionMode.InsertAfter,
            UpdateTargetId = "search-results-grid",
            OnComplete = "OnCompleteMethod"
      }))
      {
               ....
      }

    <div id="search-results-grid"></div>

an the script with the OnCompleteMethod is below

    function OnCompleteMethod(dataq, status) {
        if (status === "success") {
            $("#search-results-grid").kendoGrid({
                columns: [
                    {
                        field: "jobname",
                        title: "Job Type"
                    }
                dataSource: {
                    data: {
                        "items" : dataq
                    },
                    schema: {
                        data: "items"
                    }
                },
                groupable: true,
                sortable: true,
                pageable: {
                    refresh: true,
                    pageSizes: true,
                    buttonCount: 5
                },
                noRecords: {
                    template: "No data available on current page. Current page is: #=this.dataSource.page()#"
                }
            });
        }
    }
 
and the data that I am returning looks like this after I call the controller

    [
      {
        "jobname": "job1"
      },
      {
        "jobname": "job2"
      }
    ]

What I am doing wrong here?
Viktor Tachev
Telerik team
 answered on 18 May 2017
2 answers
177 views
I can't display in a kendo grid the data that I am returning from my Controller as Json Result.


        
[HttpPost]
public ActionResult PermitSearch(BptSearchViewModel viewModel)
{
    var data = appService.SearchPermitInspection(viewModel);
     
    return Json(data, JsonRequestBehavior.AllowGet);
}


now from my View I am submitting the information using ajax

      
@using (Ajax.BeginForm("PermitSearch", "Home", null, new AjaxOptions
      {
            HttpMethod = "post",
            InsertionMode = InsertionMode.InsertAfter,
            UpdateTargetId = "search-results-grid",
            OnComplete = "OnCompleteMethod"
      }))
      {
               ....
      }
 
    <div id="search-results-grid"></div>

an the script with the OnCompleteMethod is below

function OnCompleteMethod(dataq, status) {
    if (status === "success") {
        $("#search-results-grid").kendoGrid({
            columns: [
                {
                    field: "jobname",
                    title: "Job Type"
                }
            dataSource: {
                data: {
                    "items" : dataq
                },
                schema: {
                    data: "items"
                }
            },
            groupable: true,
            sortable: true,
            pageable: {
                refresh: true,
                pageSizes: true,
                buttonCount: 5
            },
            noRecords: {
                template: "No data available on current page. Current page is: #=this.dataSource.page()#"
            }
        });
    }
}
 
and the data that I am returning looks like this after I call the controller

    
[
      {
        "jobname": "job1"
      },
      {
        "jobname": "job2"
      }
    ]


What I am doing wrong here?
Georgi
Telerik team
 answered on 18 May 2017
7 answers
198 views
How do we prevent popping up keypad when using this multiselect widget. It is text input box. if we make it read-only then the multiselect feature won't work.
Misho
Telerik team
 answered on 18 May 2017
1 answer
93 views

http://docs.telerik.com/kendo-ui/controls/editors/multiselect/how-to/selection/preselect-items-using-mvvm

Having sample code is good, but code is not an explanation. Code is what, code is not why.

For example:

   var products = model.products;            // preselected products
   model.set("products", []);                      // why is this necessary?
   model.set("products", products);

I'm new to Kendo (and JS frameworks in general), while I am finding a decent amount of sample code, the lack of proper tutorials means a longer learning curve.

Nencho
Telerik team
 answered on 18 May 2017
6 answers
820 views
Hi Guys,

I have notice when exporting a groupped grid to excel the aggregate cells in excel are offset for some reason to the left and do not match the browser grid aggregate layout and as such the exported file doesnt look as good as it should.
This can behavior can easily be replicated in the kendo demo page at http://demos.telerik.com/kendo-ui/grid/excel-export

Cheers!


Alex Hajigeorgieva
Telerik team
 answered on 18 May 2017
5 answers
1.1K+ views

Hello,

I have found I cannot select text from grid and copy it to clipboard. When searching this issue I have found the following demos. In the first demo I can select text and copy it:

http://jsfiddle.net/OnaBai/uj6sr9ez/

 

However, in the following demo I cannot copy the text from cell or row:

http://demos.telerik.com/kendo-ui/grid/selection

which demonstrate the problem.

My question is how I enable text copying (either cell(s) or row(s)) from grid to clipboard.

 

Thanks in advance,

Emanuel

Boyan Dimitrov
Telerik team
 answered on 18 May 2017
1 answer
657 views

Hi all,

I am successfully load datasource data from server and then i remove some items from the datasource then i bind it to the combobox. the problems is that the removed data still appear? 

 

// data from server works fine

comboData: kendo.data.DataSource = new kendo.data.DataSource({
transport: {
read: {
dataType: "jsonp",
url: `my url`
}
}
});

 

//combobox binding

this.comboBox = $("#elementid").kendoComboBox({
dataTextField: "DisplayName",
dataValueField: "SchemaName",
select: (e) => this.onSelectionChanged(e),
dataSource: this.comboData
}).data("kendoComboBox").focus();
$("#elementid").data("kendoComboBox").open();

 

// remove data from datasource

var rawData:any = this.comboData.data();

for(let dataItem of rawData){
if(my condition ) {
this.comboData.remove(dataItem);
}
}

Ivan Danchev
Telerik team
 answered on 18 May 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?