Telerik Forums
Kendo UI for jQuery Forum
2 answers
524 views

I'm looking at a case where the "defaultValue" sort of initialization of a Model may not be sufficient.  I wanted to try and hook in to Model's constructor process, but I'm not quite successful.  I have a little example on the dojo that sets up the Model, a DataSource that uses it with a couple rows of data, and a grid that displays it. 

It tries to use the "init" event handler inherited by kendo.data.Model from kendo.Class with my custom constructor function (MyConstructor).  This works in that my constructor function gets called, and I can successfully manipulate the data record (available as "this").  But something about this seems to prevent the datasource from actually finishing up initializing the records with the actual data, even if I make no actual modifications in MyConstructor().  "id" and "description" have their default values, not those from the array of data records that you see when the init constructor does not run.  

I do "kendo.data.Model.call(this)" to run the parent constructor from Model - perhaps something slightly different is needed?   Or is there some other proper way to hook into model construction?  It is for the "create" process on for a grid, so the model instance is created and bound to the edit template all internally in kendo code before I can get ahold of it via the grid's "edit" event.  

Alex Hajigeorgieva
Telerik team
 answered on 16 Jan 2017
1 answer
7.8K+ views
We are using a Kendo grid. I created a table in my cshtml file and in my js file, I bind it to the data. My problem here is that the grid paging does not go away. I need all the items on one single page since we don't expect much load. I tried removing the pageable attribute and I tried marking pageable: false. But I still see that the grid displays only 10 items in one page and gives the paging.By using this.pager.element.hide(), we can hide the pager but that does not solve the purpose since the pager is hidden but the paging is still being done. So, now, the elements starting 11th element are on the next page but we wont be able to navigate to it.Here is the existing code. I have removed the irrelevant columns in the table.

.CSHTML File:

<table style="width: 100%;" class='list-entity' id='inboxItems'>
<thead>
<tr>
<th data-field='Actions' class="iconCell" style='width: 1%'>&nbsp;</th>
<### THERE ARE MORE COLUMNS HERE AND THOSE HAVE CORRESPONDING COLUMNS IN SETTINGS ###>
</tr>
</thead>
</table>

Here is the script:

var settings = {
kendosettings: {
dataSource: {
data: requestItemsList,
schema: {
// required if get method will be used
model: {
id: "StepApproverKey"
}
},
group: [
{
field: "GroupByAttribute",
dir: "asc",
aggregates:
[
{ field: "GroupByAttribute", aggregate: "count" }]
}]
},
sort: { field: "SubmittedOn", dir: "desc" },
sortable: true,
pageable: false,
scrollable: false,
columns: [
{
field: "Actions",
title: "Actions",
template: kendo.template($("#inboxrowEditTemplate").html())
},
{ field: "StepApproverKey", hidden: true },
{
field: "GroupByAttribute",
hidden: true,
groupHeaderTemplate: kendo.template($("#inboxrowgroupHeaderTemplate").html()),
headerAttributes: {
style: "width: 100%"
}
}
],
selectable: "row",
}
};
$('#inboxItems').pdi().displaygrid(settings);
Dimiter Topalov
Telerik team
 answered on 16 Jan 2017
2 answers
560 views

Hi, 

As my title says, I'm trying to execute a method/callback after the user has navigated to a new view (ie, month) as I'd like to make changes to the structure of the calendar in month view.

I see that the 'navigate' callback execute before the change, is there some way to execute a method after new view is loaded?

Thanks,
Grant

Grant
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 16 Jan 2017
1 answer
101 views
The documentation specifies that minLength defaults to 0. However behavior of MultiSelect changes when minLength is explicitly set to 0. Clicking on the MultiSelect with the mouse no longer opens the list of values to select. See http://dojo.telerik.com/AWutut
Dimiter Topalov
Telerik team
 answered on 16 Jan 2017
4 answers
830 views
We are considering kendo ui to replace GWT in our ERP product. The main motivator is kendo grid. We have many composite objects that are rendered and edited as a single column. The column editor will contain multiple fields.
An example: In sales invoice lines, the product column should display product code (autocomplete field), product name (Link), and a button to open products browser (a modal dialog with search fields and a grid that displays products along with images, names, available quantities, etc).After selecting a product in the products browser the grid should update the product in the row that requested the browser.
I think I know how to implement the products browser. But the composite editor is the one I do not know how to implement.
My question is: how can I edit a composite object in a single grid column using a composite widget? And we need inline editing not popup editors.
I have been browsing the demos to find a close example but could not find any. My search was "kendo grid composite object custom editor".
Attached two screen shots of our current ui that uses GWT.
Vladimir Iliev
Telerik team
 answered on 16 Jan 2017
1 answer
481 views

I have the following data representation displayed in a TreeList where there are two columns:  Name and Creation Date.  (Each Value entry is a child of the parent Item entry.)

Name - Creation Date

Item 1 - Jan 01, 2017

     Value 1 - Jan 11, 2017
     Value 3 - Jan 02, 2017
     Value 2 - Jan 01, 2017

Item 2 - Dec 20, 2016

     Value 2 - Dec 20, 2016
     Value 1 - Dec 17, 2016
     Value 3 - Dec 16, 2016

Item 3 - Nov 15, 2016

     Value 3 - Nov 25, 2016
     Value 1 - Nov 22, 2016 
     Value 2 - Nov 20, 2016

What do I need to do in order to sort by the Name value vs. the Creation Date so that it appears as follows:

Item 1 - Jan 01, 2017
     Value 1 - Jan 11, 2017
     Value 2 - Jan 01, 2017
     Value 3 - Jan 02, 2017

Item 2 - Dec 20, 2016
     Value 1 - Dec 17, 2016
     Value 2 - Dec 20, 2016
     Value 3 - Dec 16, 2016

Item 3 - Nov 15, 2016
     Value 1 - Nov 22, 2016 
     Value 2 - Nov 20, 2016
     Value 3 - Nov 25, 2016

No sort order is set in the TreeList markup; all the columns in the TreeList are sortable such that if I click the Name column header, the child rows are sorted appropriately.

Eduardo Serra
Telerik team
 answered on 13 Jan 2017
6 answers
184 views

If the resources dont fit the scheduler a vertical scroll appears (in case the scheduler is with fixed height).

Thats ok, but the issue is that the time and date headers widths start to miss their alighmen with the content columns ( more stronger over time. )

Here is the dojo http://dojo.telerik.com/eXUqI

Choose for example "Timeline week" and the scroll to the right.

Ivan Danchev
Telerik team
 answered on 13 Jan 2017
8 answers
276 views

I'd like to implement a custom icon in the header, which when clicked, shows a customizable menu (similar to the context menu in the Spreadsheet component).

Is there anything built in which can help me? If not can you please provide the code used to show the context menu in the spreadsheet).

Thanks!

Dimiter Madjarov
Telerik team
 answered on 13 Jan 2017
1 answer
407 views
I'm trying to include a Bootstrap-Switch control (or anything similar).  I've got a regular ASP.NET MVC site, with a TypeScript MVVM view model.

 

I've included the bootstrap switch from here:

https://github.com/nostalgiaz/bootstrap-switch

If you know of an easier way to accomplish the same thing, I'm definitely open to that.

<input type="checkbox" data-bind="bootstrapSwitch: billingSettings.capsIncludeFees, events: {change: cpChanged}"/>

Here's my markup in the view:

And then I have the following custom binding:

kendo.data.binders.bootstrapSwitch = kendo.data.Binder.extend({
    init: function (element, bindings, options) {
        var x = this;
        kendo.data.Binder.fn.init.call(this, element, bindings, options);
        var that = this;
        $(that.element).bootstrapSwitch();
        $(that.element).on('switchChange.bootstrapSwitch',
            function(event, state) {
                that.change();
            });
    },
    refresh: function() {
        var that = this;
        var value = that.bindings["bootstrapSwitch"].get();
        $(that.element).bootstrapSwitch("state", value);
    },
    change: function () {
        if (this.bindings.events && this.bindings.events.change && this.bindings.events.change.parents) {
            var changeBinding = this.bindings.events.change;
            for (var i = 0; i < changeBinding.parents.length; i++) {
                var parentObservable = changeBinding.parents[i];
                var method = changeBinding.path;               
                //parentObservable[method]();
            }
        }
 
        var value = this.element.value === "on";
        this.bindings["bootstrapSwitch"].set(value);                  
    }
});

But the custom binding doesn't actually change the property on my viewModel itself -- or fire the change event.  I hit the breakpoints in my custom binding and can see that the "parents" within the bindings have the stuff I need, but not the "this" object itself. 

If you have a better way to do what I'm after, let me know.  Otherwise, can you help me figure out what is wrong with my custom binding?

Thanks in advance -

Erik

ps I tried setting up a snippet in the dojo for this, but couldn't figure out how to properly include bootstrap and the bootstrap switch.  I can create a sample project on github if it becomes required.

 

 

 

 

 

 

 

 

 

 

 

Stefan
Telerik team
 answered on 13 Jan 2017
5 answers
331 views

I am using this method to iterate a range, however, the value parameter does not have a value attribute - it only has the prototype value.

I am populating the data using a webservice, and use AngularJS in my application.

Can you think of any reason I dont have the value attribute (the cells have data in)

Thanks

Marc!

Marc
Top achievements
Rank 1
 answered on 13 Jan 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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?