Telerik Forums
Kendo UI for jQuery Forum
3 answers
233 views
If I filter data in a grid, and then go to clear that filter by simply clearing the filter string and clicking 'Filter', I would like to perform the same action as clicking 'Clear'. Is this at all possible? If so, how? TIA
David
Top achievements
Rank 1
 answered on 24 Apr 2014
5 answers
481 views
I have a grid with columns `start` and `end`. I have a template for the start column that shows the two integers concatenated as a range. E.g., "1 - 2". I put a custom editor on this templated column and want to be able to parse the range and set both start and end. Where should I perform this parsing logic? I tried to do it on the datasource change event but calling .set() on the dataitem ends up re-calling the event.
Daniel
Telerik team
 answered on 24 Apr 2014
3 answers
286 views
Hi guys,
Is it possible to use variables for titles in Grids.I am trying to do internationalization so that Title can come from DB / CMS system .

editable : "inline",
columns : [
{
field : "OrderID",
title : '$T_OO1', <--------instead of "Order ID"
filterable : true,
width : '20%'
},
Dimiter Madjarov
Telerik team
 answered on 24 Apr 2014
2 answers
667 views
This seems like a simple one but I am having issues finding a fix.  On window, I have 4 dropdowns and a grid.  A person can select from the dropdown and that will filter the grid.  Now that you have a filtered grid, you can then click on the grid column to filter at the column level.  The issue is that the dropdown list on the grid column filter does not reflect the filtered grid results.  Basically it is still the full potential list of choices instead of the reduced list since the grid was filtered.

So, how does one call a function to change the column filter datasource and
how do you get the now reduced datasource from the column?

Thanks.
Petur Subev
Telerik team
 answered on 24 Apr 2014
1 answer
110 views
I have a controller that returns an HttpResponseMessage.

public HttpResponseMessage Get()
{
    return GetByEnteredDate(Convert.ToDateTime("10/16/2013"));
}
 
public HttpResponseMessage GetByEnteredDate(DateTime enteredDate)
{
    return GetByEnteredDates(enteredDate.Date, enteredDate.Date.Add(new TimeSpan(23, 59, 0)));
}
 
public HttpResponseMessage GetByEnteredDates(DateTime fromDate, DateTime thruDate)
{
    var licenses =
        (from li in repository.All
         where !li.Deleted
         && li.DateEntered >= fromDate
         && li.DateEntered <= thruDate
         select li).ToList();
 
    if(licenses != null && licenses.Any())
    {
        return Request.CreateResponse<IEnumerable<LicenseDto>>(HttpStatusCode.OK,
            mapper.Map<IEnumerable<Hialeah.License.Domain.License>, IEnumerable<LicenseDto>>(licenses));
    }
 
    throw new HttpResponseException(HttpStatusCode.NotFound);
}

I then create a simple page and try to load a grid. For the life of me, I have not been able to make it work. I know the service returns data. But I can't even see the call in Google chrome. It just shows the grid with no data. I have tried many combinations in the schema. I place a break point on the Get() method and it doesn't get there. :-(

<div id="licensesGrid"></div>
 
<script type="text/javascript">
 
    $(document).ready(function () {
 
        var licenseDataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "api/licenses",
                    datatype: "json"
                }
            },
            schema: {
                data: function (response) {
                    return response.Data;
                }
            },
            pageSize: 10
        });
 
        $("#licensesGrid").kendoGrid({
            datasource: licenseDataSource,
            pageable: true,
            sortable: true
        });
 
    });
 
 
</script>

Thank you so much,
Carlos
Petur Subev
Telerik team
 answered on 24 Apr 2014
1 answer
585 views
Hi there,

I created a data bound date picker using the data-role attribute as follows: 

         <input id="startDatepicker" name="startDatepicker" class="datePicker" data-role="datepicker" data-bind="value: settings.startDate" data-format="yyyy-MM-dd" />

when I try to change the data-format to 'dd-MM-yyyy' the value wont show up, I think its because the default culture is en-US and therefore the date value becomes invalid. is there a way to specify the culture of the control to say en-NZ so that I can specify the format to dd/MM/yyyy correctly?

There are quite a few examples with setting date format as follows:

$("#datepicker").kendoDatePicker({
culture: "de-DE"
});

but does say how to do data binding if I am doing it this way

Any suggestions around either approach is greatly appreciated. 

Thanks
Paul 
Georgi Krustev
Telerik team
 answered on 24 Apr 2014
1 answer
626 views
Hi,

I have a grid with date column. If the date value is greater than 30 then i want to display the date value as is otherwise display the difference in days like "In x Days".

I able to display formatted date value or difference in days correctly using the below code.

div class="col-md-12" id="recurringPaymentList">
@(Html.Kendo().Grid<PaymentsModel>()
.Name("scheduledPayment")
.Columns(columns =>
{
columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 )) #"
);

However, when i try to contenate string values (see code below) in the ternary expression grid data does not bind and i dont see any error.

columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : 'In ' + kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))  " ' Day' #"
);

Is there any way to get the string contenate work in ternary expression or any other way of doing this?
 

Dimiter Madjarov
Telerik team
 answered on 24 Apr 2014
1 answer
196 views
When I remove and then add a row in the Kendo grid, it increments the value by 1 instead of showing the same number of rows.

For eg, if I have only one row,

var dataSource1 = $("#grid").data("kendoGrid").dataSource;
a =dataSource1.data()[0];
dataSource1.remove(a)
alert("Total after removing a row : " + dataSource1.total()) // Now this is 0
dataSource1.add("Total after adding the same row" + a)
alert(dataSource1.total()) // Now this gives 2?!?!?!

But looking into the grid.dataSource.data().length gives the correct value of 1.
Due to this, the number of records present in the table shown in the table footer is displayed incorrectly.() It is shown as (1 - 2 of 2 records, instead of 1-1 of 1 record)

This also works for removing and adding multiple rows.
Rosen
Telerik team
 answered on 24 Apr 2014
1 answer
118 views
Hi,
is it possible to use the recurrence control without the scheduler?
is yes, is there an example I can look at?
Thanks,
Mickey
Vladimir Iliev
Telerik team
 answered on 24 Apr 2014
1 answer
221 views
I notice in the Sortable demos you guys show how to move an item in a DataSource instance on the change event.  How would I go about properly doing this if I am using an ObservableArray instead?
Alexander Valchev
Telerik team
 answered on 24 Apr 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?