Telerik Forums
Kendo UI for jQuery Forum
1 answer
2.2K+ views
How to get remove title from the Kendo MVC jquery Grid Destroy Command confirmation message ? Please see the attached file. below my grid command. I want to remove "locahost:50144 says" title.
command: [{ className: "btn ez-icon-btn text-danger", name: "destroy", text: "" }]

Can anyone help me how to do that?
FYI, I'm working on ASP.NET MVC with Kendo jQuery Grid. Thanks !
Alex Hajigeorgieva
Telerik team
 answered on 31 Aug 2020
1 answer
310 views

Hi Team,

 

Getting ajax call twice for same input if specifying minLength in multiselect. Could you please suggest why ajax call invoke twice for same input with minLength.

 

HTML:<div><select id="required" multiple="multiple" style="width: 92.5%; margin-top: 21px; margin-left: 2px;" "></select></div>

 

JS Code:  

var searchuserdataSource = new kendo.data.DataSource({
        pageSize: 30,
        serverFiltering: true,
        transport: {
            read: function (options) {
                var srctxt = {
                    //searchText: $('#required').data("kendoMultiSelect").input.val()
                    searchText:"Test"   
                };

                var params = "{searchText: '" + srctxt.searchText + "'}";
                $.ajax({
                    type:"POST",
                    url: "./Relationships.aspx/GetUserSearch",
                    data: params,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {
                        var userslist = [];
                        if (typeof result.d !== 'undefined' && result.d.Completed)
                        {
                            $.each(result.d.Data, function (i, item) {
                                var map = {};
                                map["id"] = item.Id;
                                map["name"] = item.DisplayName;
                                userslist.push(map);
                            });
                           
                        }
                        options.success(userslist);
                    },
                    error: function (result) {
                        options.error(result);
                    }
                });  
            }
        }
    });


$("#required").kendoMultiSelect({
    autoBind: false,
    minLength: 3,
    enforceMinLength: true,
  dataSource: searchuserdataSource,
  dataTextField: "name",
  dataValueField: "id",
//itemTemplate :"<input type='checkbox' id='#:data.id#'/> #:data.name#",
  //itemTemplate: " <input type='checkbox' name ='#:data.name #' value ='#:data.id#' class='k-checkbox' /><label class='k-checkbox-label' value='#:data.id#' > #:data.name# </label>",
//itemTemplate:"<input type='checkbox' name='#:data.name # value='#:data.id #' class='k-checkbox' />" +
        //"<span class='k-checkbox-label' data-value='#:data.id #'>#:data.name #</span>";
  autoClose:false,
  tagMode:"single",
  //tagTemplate:'<span>#: data.values.length # user(s) selected</span>',
    filter: "contains",
    //placeholder: "Search..",
    delay: 200,
  close: function(){
           var selectedItems =$("#required").data("kendoMultiSelect").dataItems();
           if(selectedItems.length !=0)
              {
                 $.each(selectedItems,function(index,obj){
                       //alert("Name: "+obj.name+"\n"+"Id:"+obj.id+"\n");
                        CreateUsersFilter(obj.id,obj.name);
            
              });
             if (dummyfiltersource.length >= 14)
              $(".selectedusersgrid").width("94%");
             }

 }
});     

Aleksandar
Telerik team
 answered on 31 Aug 2020
3 answers
343 views

hello,

 

How can I get the Saturday and Sunday columns in the Gantt chart and color them?
Do you provide such an interface?

 

We look forward to your reply!

 

 

thank you!

Dimitar
Telerik team
 answered on 28 Aug 2020
1 answer
152 views

 

Referring to the below example:

https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/diagram/configuration/shapes.editable.tools

I would like to customize the toolbar of shapes when using a datasource. 

  $("#diagram").kendoDiagram({
                    dataSource: shapesDataSource,
                    connectionsDataSource: connectionsDataSource,
                    layout: {
                        type: "tree",
                        subtype: "tipover",
                        underneathHorizontalOffset: 140
                    },
                    shapeDefaults: {
                        visual: visualTemplate,
                        content: {
                            template: "#= dataItem.JobTitle #",
                            fontSize: 17
                        }
                    },
                    connectionDefaults: {
                        stroke: {
                            color: "black",
                            width: 2
                        }
                    },
                    //editable: {
                    //    tools: [{name: "createShape"}]
                    //},
                    dataBound: onDataBound,
                    toolBarClick: onToolBarClick
                });

Anton Mironov
Telerik team
 answered on 28 Aug 2020
1 answer
200 views

I am trying to add custom tool in org chart to update a value on node. The value gets updated on the datasource but not on the chart.

Nor does it trigger API hit to update the new value

$("#diagram").kendoDiagram({
                   dataSource: shapesDataSource,
                   connectionsDataSource: connectionsDataSource,
                   layout: {
                       type: "tree",
                       subtype: "tipover",
                       underneathHorizontalOffset: 140
                   },
                   shapeDefaults: {
                       visual: visualTemplate,
                       content: {
                           template: "#= dataItem.JobTitle #",
                           fontSize: 17
                       }
                   },
                   connectionDefaults: {
                       stroke: {
                           color: "black",
                           width: 2
                       }
                   },
                   //editable: {
                   //    tools: [{ name: "createShape" }, { name: "edit" },
                   //    { name: "undo" }, { name: "redo" }],
                   //    shapeTemplate: kendo.template($("#popup-editor").html())
                   //},
                   editable: {
                       tools: [{
                           type: "button",
                           text: "Set Selected Content",
                           click: function () {
                               var selected = $("#diagram").getKendoDiagram().select();
                               var content = $("#content").val();
                               for (var idx = 0; idx < selected.length; idx++) {
                                   selected[idx].dataItem.JobTitle = content;
                               }
                           }
                       }, {
                           template: "<input id='content' class='k-textbox' value='Foo' />"
                       }]
                   },
                   dataBound: onDataBound,
                   toolBarClick: onToolBarClick
               });

 

Anton Mironov
Telerik team
 answered on 28 Aug 2020
2 answers
272 views
I have the pleasure of dealing with the code someone else has written that affects every grid on our site (about 100).  
Here is the problem. His default "DataBound" event resizes the action column we have at the left of our grids so that it matches the width of the displayed buttons.  Makes sense.  However, he has code in there that when the grid is intiialized, unbinds the current databound event then rebinds it to his special databound event.  It looks like he assumed that this is the only usage we would ever have for databound.

I discovered this when i created a custom databound on a grid, and it was never called.

Is there a way to modify this code so that it stores the current databound event and reapplies it?

       
gridSelector = gridSelector || "#grid";
 
// scoped function that can be assigned to the dataBoundEvent and called directly (below)
var doGridDataBound = function (me, gridSelector, grid) {
    me.InitMenu(gridSelector);
    setTimeout(function () {
        grid.autoFitColumn(actionColIndex);
    }, 500);
};
 
var grid = $(gridSelector).data("kendoGrid");
// delay "connecting" the dataBound event handler for 250ms to give time for other event handlers to be assigned first (we need this one to "fire" last)
// specifically - customKendoButtons_OnDataBound needs to fire earlier than this one to ensure that the buttons are visible/fully defined before "autoFit" is executed
grid.unbind("dataBound").bind("dataBound", function () {
    doGridDataBound(me, gridSelector, grid);
});
/* if any data rows already exist, then the dataBound event will not fire again, so fire it now */
if ($(gridSelector).find("input.gridPopupHelper").length)
    doGridDataBound(me, gridSelector, grid);

John
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 28 Aug 2020
1 answer
161 views

Hi,

We have the Open Street Map example working, but in the documentation, it says...

"Displaying raster maps from popular online providers such as OpenStreetMap, OpenWeatherMap, ArcGIS, and so on." 

Does Telerik or anyone else have any working examples of using the Kendo UI Map control with different providers. Either ArcGIS or any other service?

Much appreciated,

George

Tsvetomir
Telerik team
 answered on 28 Aug 2020
1 answer
6.6K+ views
We have a strange issue where the edit template for our grid is causing issues when editing dates.The dates are stored on the server in UTC timezone.
We use the following pattern to set the timezone:-       
private DateTime _minDate;       
public DateTime MinDate        {           
    get { return _minDate; }           
    set { _minDate = DateTime.SpecifyKind(value, DateTimeKind.Utc); }       
}
The dates get loaded into the grid using WebApi OData services.{"Id":50088,"ProductId":101437,"Valor":"12224000","ISIN":"CH0122240002","Description":"Outperformance Bonus Certificate, Multi Shares","Provider":"CSIB","AlertedTicker":"KO UN","ProtectionPercentage":1.0,"ProtectionType":"Protection Lost","UnderlyingCurrency":"USD","BarrierLevel":190.0,"BarrierPercentage":70.0,"BarrierType":"Low","BarrierId":0,"EventStructureId":170378,"Date":"2013-11-20T00:00:00Z","Comment":null,"Confirm":false,"Reject":false}The OData service correctly serializes the UTC date and the date get to the UI intact.After editing the date using a date picker control but just typing using the keyboard the data is sent back to the server in the wrong format.{ "odata.metadata":"http://localhost:51850/web/odata/$metadata#PendingBarrierAlerts/@Element","Id":50088,"ProductId":101437,"Valor":"12224000","ISIN":"CH0122240002","Description":"Outperformance Bonus Certificate, Multi Shares","Provider":"CSIB","AlertedTicker":"KO UN","ProtectionPercentage":1.0,"ProtectionType":"Protection Lost","UnderlyingCurrency":"USD","BarrierLevel":190.0,"BarrierPercentage":70.0,"BarrierType":"Low","BarrierId":0,"EventStructureId":170378,"Date":"2013-11-20T23:00:00Z","Comment":null,"Confirm":false,"Reject":false}Notice the date has a changed time !How can we edit UTC dates in a grid and correctly return them to the server using OData as a transport and a remote datasource ?
Eyup
Telerik team
 answered on 28 Aug 2020
2 answers
90 views

This my Editor

function userNameAutoCompleteEditor(container) {
 
    $('<input id="UserId" name="UserId">')
        .appendTo(container)
        .kendoComboBox({
            autoBind: false,
            dataTextField: "UserName",
            dataValueField: "UserId",
            filter: "contains",
            minLength: 3,
            valuePrimitive: true,
            dataSource: new kendo.data.DataSource({            
                contentType: "application/json; charset=utf-8",
                serverFiltering: true,
                transport: {
                    read: {                       
                        url: '../Warehouse/SearchUser' ,
                        data: function () {
                            debugger;
                            UserSearcText:"asd"
 
                        }
                        
                    }
                },
            }),
        });
}

 

///Mvar grid = new BaseGrid('grdWarehouse_OnWarehouseUserRelation');
    grid._batch = false;
    grid._dataSourceAutoSync = false;
    grid._toolbar = ['create'/*, 'save', 'cancel'*/];
    grid._editable = {
        mode: "inline",
        create: true,
        update: true,
        destroy: true,

    };
    grid._autoBind = false;
    grid._schemaMethod = {
        model: {
            id: 'Id',
            fields: {
                Id: { editable: false },
                //User: { defaultValue: { UserId: '', UserName: '' } },
                
            }
        }
    };
    grid._columns.push(grid.GridColumn('Id', null, '200px', null, null, null, null, null, null, null, true));
    //grid._columns.push(grid.GridColumn('User', 'User', '200px', null, "#=User.UserName#", null, null, null, null, null, null, null, null, null, userNameAutoCompleteEditor));
    grid._columns.push(grid.GridColumn('UserId', 'User', '200px', null,'#=modelName(this)#', null, null, null, null, null, null, null, null, null, userNameAutoCompleteEditor));
    grid._columns.push(grid.GridColumn(null, '&nbsp;', '200px', { style: 'text-align:right' }, null, null, null, null, null, null, null, null, null, ['edit', 'destroy']));

    grid._cancelMethod = function (e) {
        var uid = $("#grdWarehouse_OnWarehouseUserRelation").data("kendoGrid").dataItem($(e.container).closest("tr")).uid
        dataSource = $("#grdWarehouse_OnWarehouseUserRelation").data("kendoGrid").dataSource
        var item = dataSource.getByUid(uid);
        dataSource.cancelChanges(item);
    };

//My problem  ı need filter text to send the controller.But  I cant catch searc text CAN YOU HELP ME!!!!??????????

This my grid

01.var grid = new BaseGrid('grdWarehouse_OnWarehouseUserRelation');
02.    grid._batch = false;
03.    grid._dataSourceAutoSync = false;
04.    grid._toolbar = ['create'/*, 'save', 'cancel'*/];
05.    grid._editable = {
06.        mode: "inline",
07.        create: true,
08.        update: true,
09.        destroy: true,
10. 
11.    };
12.    grid._autoBind = false;
13.    grid._schemaMethod = {
14.        model: {
15.            id: 'Id',
16.            fields: {
17.                Id: { editable: false },
18.                //User: { defaultValue: { UserId: '', UserName: '' } },
19.                 
20.            }
21.        }
22.    };
23.    grid._columns.push(grid.GridColumn('Id', null, '200px', null, null, null, null, null, null, null, true));
24.    //grid._columns.push(grid.GridColumn('User', 'User', '200px', null, "#=User.UserName#", null, null, null, null, null, null, null, null, null, userNameAutoCompleteEditor));
25.    grid._columns.push(grid.GridColumn('UserId', 'User', '200px', null,'#=modelName(this)#', null, null, null, null, null, null, null, null, null, userNameAutoCompleteEditor));
26.    grid._columns.push(grid.GridColumn(null, ' ', '200px', { style: 'text-align:right' }, null, null, null, null, null, null, null, null, null, ['edit', 'destroy']));
27. 
28.    grid._cancelMethod = function (e) {
29.        var uid = $("#grdWarehouse_OnWarehouseUserRelation").data("kendoGrid").dataItem($(e.container).closest("tr")).uid
30.        dataSource = $("#grdWarehouse_OnWarehouseUserRelation").data("kendoGrid").dataSource
31.        var item = dataSource.getByUid(uid);
32.        dataSource.cancelChanges(item);
33.    };

 

 

 

 

 

 

Merve
Top achievements
Rank 1
Veteran
 answered on 28 Aug 2020
1 answer
231 views

Due to some performance issues on the application.  I need to do the binding via a json file instead of using an api.  However, I was running into an issue doing sorting/filtering.

The application displays a list of data.  It needs to filter data by a date range.  

Could someone provide me a direction on what I need to do?

 

Hetali
Telerik team
 answered on 27 Aug 2020
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?