Telerik Forums
Kendo UI for jQuery Forum
1 answer
91 views

Hello,
I'm displaying start and end dates in the RangeBar chart.

I'm setting min and max range in the valueAxis as seen here:

valueAxis: {
        min: new Date("2017/04/06 07:00").getTime(),
        max: new Date("2017/04/06 17:00").getTime(),
        majorUnit: 60 * 60 * 1000, // 60 minutes in milliseconds
    labels: {
        template: "#= kendo.toString(new Date(value), 'HH:mm') #"
        }
    },

 

The problem I'm having is getTime() is returning the number of milliseconds since Epoch off by 4 hours.

In the example above, GetTime() returns 1491476400000, or "2017/04/06 11:00" instead of "2017/04/06 07:00"

The label is displaying 07:00.

I'm assuming this is some kind of UTC issue?  I live in the EDT timezone which is UTC-4 hours.
How do I need to do to have getTime() return the proper milliseconds?

Regards,

 

David

 

Daniel
Telerik team
 answered on 10 Apr 2017
2 answers
135 views
I have quite a bit of views available for the user to switch between, making this view bar quite long, and it will create a second line in the header before collapsing. I want it to collapse at screen width 1635px so it can stay neatly on one line. However, I cannot find anywhere on how you adjust when the view bar collapses.
Tyler
Top achievements
Rank 1
 answered on 07 Apr 2017
1 answer
335 views

Hi,

I am currently using Kendo UI Professional 2017.1.223 release scripts in a project which is already havind some more references. I am coming across an error

"Object doesn't support property or method 'delayedClick' " in kendo.all.min.js.

Please guide me in resolving this issue.

Thanks in advance.

Nikolay
Telerik team
 answered on 07 Apr 2017
2 answers
232 views

Hello,

I'm trying to implement a Kendo grid where two cells update each other when changed. I know I could use a calculated column if only one cell was editable and the other was calculated but I'm lost trying to let them both update each other. 

I know I could do this with a custom Javascript class and get/set methods, where the set for one updates the other, and vice versa.

For Example, say I want a grid of product prices like so:

SKU       Price        Discount        Sale Price
001       20.00          10%              18.00
002       10.00          20%               8.00
...

And I want both the Sale Price and the Discount to be editable: Editing the Sale price should update the discount to the calculated % of Price, and updating the Discount will calculate a new sale price. Furthermore, let's assume I don't actually need to save the sale price, I'm really only loading from my .Net server Sku, Price, and Discount and would like get() on Sale Price to calculate the value to display, and set() on Sale Price to calculate the new discount for saving when I submit my page. 

What is the easiest way to achieve this? Currently I'm defining a Schema in my DataSource and filling it with values then displaying my Grid.

IT Dept
Top achievements
Rank 1
 answered on 07 Apr 2017
10 answers
298 views
Hello KendoUI Team

I'd like to know what is best option (if exist one) to have week number in the calendar.
The idea is to have exactly what we have with ASP.NET AJAX controls:
http://demos.telerik.com/aspnet-ajax/calendar/examples/functionality/mainareacustomization/defaultcs.aspx

Regards

Guilherme
Boyan Dimitrov
Telerik team
 answered on 07 Apr 2017
2 answers
612 views

HI

I have found a problem about field name in edit mode.

incell mode - edit event : 

  var grid = e.sender;
  var index = e.container.index();
  var field = grid.columns[columnIndex].field;

without locked column, the field name is correct : 

Click Column2 - index 1 field "Column2" <-- CORRECT

HiddenColumn Column1 Column2
0    1

but with locked column, the index is wrong, because locked column always 
place in the first of the grid.columns collection and get the wrong field :

Click Column2 - index 1 field "HiddenColumn" <-- WRONG

Column1(Locked) HiddenColumn Column2
0               1 

Is there have any solution or fixed in the newest release ?

*Visual Studio 2015 Enterprise Update 3
*UI for ASP.NET MVC Q2 2016(kendo\2016.2.504)

Best regards

Chris

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 07 Apr 2017
1 answer
171 views

Ive been working off this demo

http://demos.telerik.com/aspnet-mvc/treeview/remote-data-binding

 

And I can populate my treeview without any problems

Ive been trying to get the value of a textbox 

 

<input type="text" class="form-control" id="searchString" placeholder="Leit" value="" size="50" onkeypress="if (event.which == 13) { $('treeview').getTreeView().dataSource.read(); }">

as you can see the textbox is called searchString

this is my treeview in my cshtml file

@(Html.Kendo().TreeView()
        .Name("treeview")
        .TemplateId("treeview-template")
        .DataSource(source =>
        {
        source.Read(read => read.Action("Read_TemplateData", "Home", new { searchString = "" })) ;
        })
    )

I dont quite know how to get the contents of that textbox into the searchString = since I usually do this by doing + $('searchString').val() which just concatenates the value on the end of the url.

the read_templateData is also the "standard" action.

I would like to be able to enter a searchtext in the searchbox and only return lines where the .text field contains what is in the searchString textbox. So I would use the .contains(searchString) of a list server side.

 

any ideas ?

Regards,

Emil

Ivan Danchev
Telerik team
 answered on 07 Apr 2017
3 answers
755 views

Hi Telerik Team,

I have a KendoGrid defined as below:

@(Html.Kendo().Grid(Model.ExceptionList)
            .Name("ThesholdGrid")
            .Columns(columns =>
            {
                columns.Bound(p => p.StoreID).Title("StoreID").Width(100);
                columns.Bound(p => p.StoreName).Title("Store Name");
                columns.Bound(p => p.StockCode).Title("StockCode").Width(125).EditorTemplateName("StockCodeAutoComplete");
                columns.Bound(p => p.ItemDesc).Title("Item Desc");
                columns.Bound(p => p.NoThres).Title("No Stock Threshold");
                columns.Bound(p => p.LowThres).Title("Low Stock Threshold");
                columns.Command(cmd => cmd.Destroy()).Width(150);
            })
            .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .Sortable()
            .Resizable(resizable => resizable.Columns(true))
            .DataSource(dataSource => dataSource
                .Ajax()
                .ServerOperation(false)
                .Model(model =>
                {
                    model.Id(p => new { p.StoreID, p.StockCode });
                    model.Field(p => p.StoreName).Editable(false);
                    model.Field(p => p.ItemDesc).Editable(false);
                })
                .Update("UpdateInvTransReview", "Inventory")
            )
)

The template for the AutoComplete:

@(Html.Kendo().AutoCompleteFor(m=>m)
          .DataTextField("StockCode")
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetStockCodes", "Inventory").Data(@"function () {
                            return {
                                keyword: ?
                            };}");                 
              });
          })
          .HtmlAttributes(new { style = "width:100%" })
          .Filter("contains")
          .MinLength(3)
          .Height(400)
          .FooterTemplate("Total <strong>#: instance.dataSource.total() #</strong> items found")
          .Template("#:data.CombinedDesc#")
)

And the controller for the AutoComplete:

[HttpGet]
public JsonResult GetStockCodes(string keyword)
{
    if (string.IsNullOrEmpty(keyword)) return Json(new List<StockCodeDesc>(), JsonRequestBehavior.AllowGet);
    var stockCodes = _stockcodeClient.SearchStockCode(keyword);
    stockCodes.ForEach(sc => sc.CombinedDesc = sc.Desc + " (" + sc.StockCode + ")");
    return Json(stockCodes, JsonRequestBehavior.AllowGet);
}

The model for the AutoComplete:

public class StockCodeDesc
{
    public string StockCode { get; set; }
    public string Desc { get; set; }
    public string CombinedDesc { get; set; }
    <other fields>
}

The grid takes data from the model and has inline editing enabled. I would like to have the StockCode field as an AutoComplete and when user selects an item, it will populate the ItemDesc field as well.

From the model you may have guessed that the StockCode field is the text of the AutoComplete, the CombinedDesc is used as template for easier viewing and the Desc is meant to populate the column ItemDesc of the KendoGrid.

My first question is what to put as the "keyword" mapping in the definition of the AutoComplete. I've tried to user parameterMap of the Transport like:

parameterMap: function (data, action) {
    return {
        keyword: data.filter.filters[0].value
    };
}

 

But the filter is always null.

My second question is how to populate the other field of the grid based on what user selects from the AutoComplete. I figure I should approach this using select event of the AutoComplete but have found no working example.

Thank you,

Michael.

Preslav
Telerik team
 answered on 07 Apr 2017
3 answers
261 views

Noticed that when you call either the toggle, expand, or collapse function calls on a splitter, the corresponding event never fires. 

Here's a demo of the behavior:

http://dojo.telerik.com/asOJA

You can see in your console when you double click the bar, the event fires. But when you click the button which makes a toggle call, no event is fired.

Ivan Danchev
Telerik team
 answered on 07 Apr 2017
1 answer
346 views

HI all,

I've got a simple HTML table that I'm turning into a Grid. I need to Group the Grid. I have all of that working...

When I define the Grouping I choose which Field to Group on. This automatically sorts the data by this Field. However, my requirement to to actually sort by a different Field.

ie: The Grouping Field is text, but the sorting is a different numeric Field.

I can Group by the numeric Field, but then what I want is to use a groupHeaderTemplate to instead display the text of the other Field.

So, my question is twofold.

- Can I Group by my text Field, but sort the Grouping by my numeric Field?
- Or, can I Group by my numeric Field, but display the text of my other Field?

Just remember...my data is sourced from an HTML table.

I hope all that makes sense.

Thanks
John

 

Tsvetina
Telerik team
 answered on 07 Apr 2017
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
Application
Map
Drag and Drop
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
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?