Telerik Forums
Kendo UI for jQuery Forum
3 answers
538 views

Hi, Dev Team!

I have two questions:

1. How i can hide "Clear" button?

2.How i can hide annoing ".00" after integer number in NumericTextBox field? 

Dimitar
Telerik team
 answered on 06 Jul 2020
15 answers
1.7K+ views

I've created a small grid from a remote data source, and it displays fine.  Now I'm trying to add Excel and PDF exports.  The PDF export works fine, but the Excel one only exports the column headings, no data.  I've tried it with the toolbar buttons or the saveAsExcel function and gotten the same result.

 

I followed these two pages in particular:

http://demos.telerik.com/kendo-ui/grid/excel-export

http://telerikhelper.net/2014/12/30/simple-export-to-excel-from-your-data-grid-using-kendo-ui/

 

The process seems quite straightforward, so I'm not sure what I could be missing.  Any ideas?  Thank you!​​

Alex Hajigeorgieva
Telerik team
 answered on 03 Jul 2020
1 answer
203 views

Hi,

I'd like to implement remote group paging, as seen here: https://demos.telerik.com/kendo-ui/grid/grouppaging

Unfortunately, my API endpoint returns "dynamic" data via a stored procedure, rather than a consistent set of columns like api/customers, so I need to hand-code each grid READ request and return a properly formatted server-response that the grid will understand. 

I need to know what kind of READ request "payloads" (i.e. the JSON data the grid will send to the server per the grid.dataSource.transport's read URL) the grid will send to the server, code an endpoint matching that "payload", and also format the endpoint's response based on the request.

Does anyone have an example of this? Does my question make sense? 

Thanks!

Angel Petrov
Telerik team
 answered on 02 Jul 2020
1 answer
460 views

Hi, I have a problem trying to populate my child dropdown. My parent dropdown is able to be populated but once I select it, my child dropdown is still empty. I feel like the problem is once i add in ".data("filterState")" it somehow breaks. My breakpoint is hit if I do not add .data but once I add that, my breakpoint doesn't hit my controller.

 

        <td class="alignright">@Html.LabelFor(m => m.SchoolStateID, "State:", new { @class = "input-label" })</td>
        <td colspan="1" style="text-align:left">
            @(Html.Kendo().DropDownList()
                                .Name("SchoolState")
                                .HtmlAttributes(new { @class = "input-sm form-control" })
                                .OptionLabel("Select State")
                                .DataTextField("State")
                                .DataValueField("Id")
                                .DataSource(source =>
                                {
                                    source.Read(read =>
                                    {
                                        read.Action("GetStateList", "Client");
                                    });
                                })
                                        .Enable(true)
                                        .AutoBind(true)
                                 )  
        </td>
    </tr>
    <tr>
        <td class="alignright">@Html.LabelFor(m => m.CityID, "City:", new { @class = "input-label" })</td>
        <td colspan="1" style="text-align:left">
            @(Html.Kendo().DropDownList()
                                .Name("SchoolCity")
                                .HtmlAttributes(new { @class = "input-sm form-control" })
                                //.OptionLabel("Select City")
                                .DataTextField("City")
                                .DataValueField("Id")
                                .DataSource(source =>
                                    {
                                        source.Read(read =>
                                        {
                                            read.Action("GetCityList", "Client")
                                            .Data("filterCity");
                                        })
                                        .ServerFiltering(true);
                                    })
                                        .Enable(false)
                                        .AutoBind(false)
                                        .CascadeFrom("SchoolState")
                                )
        </td>

 

<script>
    function filterCity() {
        console.log($("#SchoolState").val());
        return {
            schoolstate: $("#SchoolState").val()
        };
    }

</script>

Martin
Telerik team
 answered on 02 Jul 2020
2 answers
856 views

Hi,

 

 

I'm experimenting with the kendo Grid at the moment and have been creating something that creates a grid and sends a callback down a chain when the grid's dataBound event is fired. However, a problem that's arisen is there're multiple callbacks trying to link onto the callback event at different points in the chain, like so:

function createGrid(gridOpt) {
    return new Promise(function (resolve, reject) {
        gridOpt.dataBound = function () { resolve(); };
        $$gridElement.kendoGrid(gridOpt);
    });
}
 
function foo() {
    var gridOpt = getGridOpt();
    createGrid(gridOpt).then(function () {
        console.log('important thing 2');
    });
}
 
function getGridOpt() {
    return {
        dataBound: function () {
            console.log('important call 1');
        },
        //other grid stuff
    };
}

 

However, this would mean that the second dataBound assignation would override the first.

After initialisationyou can bind events through $$gridElem.data('kendoGrid').bind('dataBound', function(){});

I can't use this in this case, as the dataBound event occurs directly after initialisation.

 

One option would simply be to check if there is already an existent function and create a wrapper function that will call both functions. This would work, but it's not exactly best practice, and I'm sure there's a way to do it properly and I just missed something.

Is there any way to bind multiple events to the grid before initialisation?

Max
Top achievements
Rank 1
 answered on 02 Jul 2020
4 answers
418 views
Hello

Please check this demo: http://dojo.telerik.com/IziME/15
If you double click the event, and click "cancel", the event disappears.

Regards,

Pawel
Petar
Telerik team
 answered on 02 Jul 2020
11 answers
454 views
I'm using a MultiSelect  as input into my scheduler widget. Works great for the input piece but when I go to edit the event the Multiselect widget won't update with multiple selection it will however update if only a single selection was picked (originally). I'm passing it a coma delimited string via the Model. Do I need to pass it a json string or object? See my code snipet below.

@(Html.Kendo().Scheduler<Mvc45CRApp.Areas.Reports.ViewModels.TaskViewModel>()
    .Name("scheduler")
    .Date(new DateTime(DateTime.Now.Ticks))
    .StartTime(new DateTime(DateTime.Now.Ticks))
    .Height(600)
    .Views(views =>
    {
        views.DayView(dailyView=>dailyView.AllDaySlot(false));
        views.WeekView(weekView => weekView.AllDaySlot(false));
        views.MonthView(monthView => monthView.Selected(true));
    })
    .Timezone("Etc/UTC")
    .Resources(resource =>
         {
            resource.Add(m => m.ReportID)
                .Title("Report Name")
                .Multiple(true)
                .DataTextField("ReportName")
                .DataValueField("ReportID")
                .DataSource(source =>
                {
                    source.Read(read =>
                    {
                        read.Action("GetReports", "Schedule", new { area = "Reports" });
                    }); 
                });
            resource.Add(m => m.ContactID)
                .Title("Contacts")
                .Multiple(true)
                .DataTextField("ContactName")
                .DataValueField("ContactID")
                .DataSource(source => {
                    source.Read(read => 
                    {
                        read.Action("GetContacts", "DropdownMenus", new { area = "Shared" });
                    }); 
                });
         })
        //.Editable(e => e.TemplateId("editor"))
        .DataSource(d => d
        .Model(m =>
        {
   
            m.Id(f => f.TaskID);
            m.Field(f => f.Title).DefaultValue("No title");
            m.Field(f => f.OwnerID).DefaultValue(1);
            m.Field(f => f.Title).DefaultValue("No title");
        })
        .Read("Read", "Schedule")
        .Create("Create", "Schedule")
        .Destroy("Destroy", "Schedule")
        .Update("Update", "Schedule")
    )
)
 IQueryable<TaskViewModel> tasks = _db.SCHEDULED_EVENT.ToList().Select(task => new TaskViewModel()
            {
                TaskID = task.SCHEDULED_EVENT_ID,
                Title = task.NAME,
                //Specify the DateTimeKind to be UTC
                Start = DateTime.SpecifyKind(task.DTSTART, DateTimeKind.Utc),
                End = DateTime.SpecifyKind(task.DTSTART, DateTimeKind.Utc),
                Description = task.DESCRIPTION,
                RecurrenceRule = task.RRULE,
                ReportID = "1,2",  // this won't update the multiselect widget
                ContactID = "2",  // passing single item updates the widget (works great)
                //RecurrenceException = task.RecurrenceException,
                //RecurrenceID = task.RecurrenceID,
                OwnerID = task.USER_ID
            }).AsQueryable();


            return Json(tasks.ToDataSourceResult(request));





Ianko
Telerik team
 answered on 02 Jul 2020
8 answers
2.4K+ views

Hi

I'm using a grid to show results from a search. Also I included the child grid for the details that shows in the detailInit event. The thing is if I change the search criteria the grid loads perfectly fine but once you click to see the details it shows the details from previous result.

I tired this and didn't work:

requestEnd: function () {
var grid = $("#grid").data("kendoGrid");
grid.refresh();
},

Also tried this:

$('#grid').data("kendoGrid").unbind('change')

With the "command" column works with unbind().click(...) but no with in de detailinit.

Thank you in advanced

Priyank
Top achievements
Rank 1
 answered on 01 Jul 2020
1 answer
220 views

Hello, I have a similar situation like here Confirmation on row selection, however I work in an AngularJS environment, so I can't work with the suggested solution directly.

$("#Grid tbody").on("mousedown", "tr", function (e) {
    var ok = confirm("Change selection?");
  
    if (ok) {
        $("#Grid").data("kendoGrid").select(this);
    }
});

 

I suppose I need to wrap it into an angular directive somehow?

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 01 Jul 2020
1 answer
184 views

Hello,

Not sure if i am posting in the right place...

Like the title says i am trying to show tooltip only on rows that exist in my array. I have a kendo grid with a checkbox, whichever checkbox the user clicks on i am storing that row in my $ctr.selectedRows[];
The example i have below, the tooltip shows up on all rows when they go back to their selection grid. I am either missing something, doing this wrong, or both.
        $("#grid").kendoTooltip({
          show: function(e){
            $ctr.selectedRows.forEach((element) => {
       this.content.parent().css("visibility", "visible");
            })
          },
          hide:function(e){
            this.content.parent().css("visibility", "hidden");
          },
          filter: "td:nth-child(1)", //this filter selects the first column cells
          position: "center",
          content: function(e){
            var dataItem = $("#grid").data("kendoGrid").dataItem(e.target.closest("tr"));
            var content = "Currently we have " + dataItem.UnitsInStock + "  " + dataItem.ProductName +"in stock";
            return content;
          }
        }).data("kendoTooltip");

Martin
Telerik team
 answered on 01 Jul 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?