Telerik Forums
Kendo UI for jQuery Forum
3 answers
1.2K+ views
Hi team,

i am pleases to use this kendo UI .. i am customizing the kendo UI drop downlist.

i want to make color picker using Kedo Dropdown.

i am able to append new elements to the dropdown, want to change the Hover color for selected Item and  after selecting i want to show color pallet and Text side by side.Can any one help me  in this context.

i am attaching a screen shot that will explains much better...

Alexander Valchev
Telerik team
 answered on 13 Dec 2012
2 answers
1.1K+ views
I'm working on a MVC 4 project and bumped in to a problem with the Kendo Grid. 

I try to use both the Sortable() and Filterable() properties of the grid, but only sorting is applied. The filter icons are visible in the columns but only triggers sorting. The Filterable() property works fine when Sortable() is removed though. 

Below is the code for the grid (slightly edited for cleaner presentation)
@(Html.Kendo().Grid<TaskViewModel>()
    .Name("UserTasksGrid")
    .Columns(column =>
        {
            column.Bound(task => task.Title);
            column.Bound(task => task.IsCompleted)
                .ClientTemplate("<input type=\"checkbox\" #= (IsCompleted === true) ? checked='checked' : '' # disabled=\"true\"")
            column.Bound(task => task.TaskType)
            column.Bound(task => task.DueDate).Format("{0:yyyy-MM-dd}")
            column.Bound(task => task.CompletedOn)
                .ClientTemplate("#= (IsCompleted == false) ? '' : kendo.toString(CompletedOn, 'yyyy-MM-dd') #")
            column.Template(model => model).ClientTemplate("<a href='/production/index?productionId=#=ProductionId#' style=\"width:\">GÃ¥ till produktionssida</a>");     
        })
        .Filterable()
        .Sortable()
        .Scrollable(scroll => scroll.Height(300))
        .Pageable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(20)
            .ServerOperation(false)
            .Model(model => model.Id(m=> m.Id))
            .Sort(sort => sort.Add(task => task.IsCompleted))
            .Read(read => read.Action("UserTasks_Read", "Task"))
        )
)
I've also tried with the ColumnMenu() property based on your demo http://demos.kendoui.com/web/grid/column-menu.html
but the problem remains (ie the column menu icon can not be clicked).

Furthermore, when I set sortable in the ColumnMenu (like below), the options for "Sort ascending" and "Sort descending" are not displayed in the menu.
.ColumnMenu(menu => menu.Sortable(true))
It would be great if I could get both filtering and sorting working on the grid.

Thanks,
Andreas
Andreas
Top achievements
Rank 1
 answered on 13 Dec 2012
2 answers
731 views
How do I get the ID of a node in a Kendo treeview from a  remote JSON and put it as a variable to use in a grid's remote datasource url as parameter?

Here is the code for tree:
<script id="treeview-template" type="text/kendo-ui-template">
            #: item.Name #
        </script>   
         <script>
             var meterid = 1179;
 
             var treeurl = 'treeview_remote_url';
             var datatree = new kendo.data.HierarchicalDataSource({
                 transport: {
                     read: {
                         url: treeurl,
                         dataType: "json",
                         cache: true
                     }
                 },
                 schema:
                                 {
                                     model:
                                     {
                                         children: "Children",
                                         fields:
                                         {
                                             id: { type: "number" },
                                             Name: { type: "string" }
                                         }
                                     }
                                 }
             });
 
             function onSelect(e) {
                 var treeview = $("#treeview").kendoTreeView({
                     select: function () {
                         meterid = ($(this).text());
                     }
                 });
                 $("#grid").data("kendoGrid").dataSource.read();
             }
 
             $(document).ready(function () {
                 $("#treeview").kendoTreeView(
                                 {
                                     template: kendo.template($("#treeview-template").html()),
                                     dataSource: datatree,
                                     dataTextField: "id"
                                 });
 
                 var treeview = $("#treeview"),
                                     kendoTreeView = treeview.data("kendoTreeView");
 
                 treeview.on("click", ".k-in", function (e) {
                     kendoTreeView.toggle($(e.target).closest(".k-item"));
                     onSelect();
                 });
             });

... and here is the code for grid:
<script>
                var dateRegExp = /^\/Date\((.*?)\)\/$/;
                function toDate(value) {
                    var date = dateRegExp.exec(value);
                    return new Date(parseInt(date[1]));
                }
                sourceUrl = "grid_remote_url... &id=" + meterid;
                $(document).ready(function () {
                    $("#grid").kendoGrid({
                        dataSource: {
                            type: "json",
                            transport: {
                                read: sourceUrl
                            },
                            refresh: true,
                            serverSorting: true,
                            scrollable: true
                        },
                        height: '100%',
                        scrollable: {
                            virtual: false
                        },
                        columns: [
                            { field: "data", title: "Date/Time", template: '#= kendo.toString(toDate(data), "dd/MM/yyyy HH:ss")#', width: '10%' },
                            { field: "valoare", title: "Energy (MWh)", template: '#= kendo.toString(valoare, "n5")#' },
                            { field: "valoare", title: "Energy (MWh)", template: '#= kendo.toString(valoare, "n5")#' }
                        ]
                    });
                });
            </script>

Any help will be apreciated. Thanks!
Princess
Top achievements
Rank 1
 answered on 13 Dec 2012
2 answers
94 views
When I turn on the "selectable" property of a Kendo grid, I get an interesting (undesirable) behavior on iOS browsers.   When you use a single swipe gesture to scroll the content of the grid, all the rows in the entire grid become selected.

So far I have confirmed this happens on Safari on iOS 5 and 6 as well as Chrome 23.0.1271.91 also on iOS 6.  I have published a standalone file to demonstrate this issue:

http://hst11.homeschooltracker.com/demo/grid.html

I look forward to any recommendations that will make it so that scrolling on these platforms does not select rows the user did not mean to select.
Jean
Top achievements
Rank 1
 answered on 13 Dec 2012
1 answer
101 views
We've run into a situation where we need to be able to tell if a view is being shown because the user clicked 'back' (whether via an HTML button, or the back button on their device/browser). Is there any way to do this from within the view's show event?

Thanks,
Jonathan
Jonathan M
Top achievements
Rank 1
 answered on 12 Dec 2012
4 answers
308 views
Hi,
We are trying to load a Kendo Tree view control with XML document as datasource. But we can't fnd any code samples for the same. We are struck here. Can anyone help us by providing some sampe code?
Hari
Top achievements
Rank 1
 answered on 12 Dec 2012
2 answers
122 views
how to get the ID(Primary key) of the ProjectGroup model ? when i want to use that ID in the method like DataServiceFactory.AdminService.GetUsersForProjectGroup(ID) , i cant bind it , just for now to check, i passed ID as "1" in the below code . can any one help how to bind the "ID "

@(Html.Kendo().Grid(Model.ProjectGroups)
    .Name("Grid")
    .Columns(columns =>
                 {
                     columns.Template(@<div><h4>@item.Name</h4><small>@item.Description</small></div>).Title("Name");
                     List<User> users = DataServiceFactory.AdminService.GetUsersForProjectGroup(1);
                     columns.Template(
                         @<div>
                         @foreach(var user in users){<p>@user.FullName</p>}</div>).Title("Members");
                     List<Partition> partitions = DataServiceFactory.AdminService.GetAccessedPartitionForProjectGroup(1);
                     columns.Template(
                         @<div>
                         @foreach (var partition in partitions)
                         {<p>@partition.Name</p>}</div>).Title("Partitions");

                     columns.Template(@<a href="@Url.Action("EditGroup", new { ID = item.ID })"><i class="icon-pencil"></i></a>);
                      
                 })
                 .Pageable()
                 .Sortable()
    )
Petur Subev
Telerik team
 answered on 12 Dec 2012
4 answers
175 views
If I navigate directly to a view in my app, without parameters, my views show as they should:  
http://localhost:34991/MobileNew/Account/Dashboard/#clientSearchByLastNameView

If I add parameters, it will 'reset' the app, and start on the first/initial view:
http://localhost:34991/MobileNew/Account/Dashboard/#clientSearchResultsView?SearchLastName=Smith

I should add, when I say "navigate", I don't mean app.navigate.  I mean a direct link from the browser's address bar.

Is this a known issue, and what is the workaround?
RodEsp
Top achievements
Rank 2
 answered on 12 Dec 2012
1 answer
168 views
Hello, I am trying to access my datasource after I read it in remotely.  The problem is that it thinks that my datasource is undefined.  I am pretty sure I am using the proper syntax because when I check the data in the change() event, it shows all the data correctly and I can access each field.  But when i try to do it outside of the code it doesn't work.  Here is my code and the errors I am getting.  PLEASE HELP!

PlayerCalculatorModule.prototype.initialize = function() {
    'use_strict';
    var self = this;
    var calcData;
    this.eventModel = kendo.data.Model.define({
        id: "playerGUID",
        playerFirstName: "playerFirstName",
        playerLastName: "playerLastName",
        pricePerTd: "pricePerTd",
        pricePerYard: "pricePerYard",
        pricePerFumble: "pricePerFumble",
        pricePerSacked: "pricePerSacked",
        pricePerIncompletion: "pricePerIncompletion",
        pricePerInterception: "pricePerInterception",
        pricePerCompletetion: "pricePerCompletetion",
        playerStartingPrice: "playerStartingPrice"
    });
    this.calcData = new kendo.data.DataSource({
        transport: {
            read: {
                // the remote service url
                url: "/Market/ServiceBeans/playerCalcService.jsp",
                // JSONP is required for cross-domain AJAX
                dataType: "json",
                // additional parameters sent to the remote service
                data: { //additional parameters sent to the remote service
                    action: "getEvents"
                }
            }
        },
        change: function () { // subscribe to the CHANGE event of the data source
            console.log(this.data());
        }
    });
    this.calcData.read();
    console.log(this.calcData.data());

};

The first time I call console.log(this.data());  Everything works as it should.  But when i call :
 console.log(this.calcData.data()); It thinks i have no data.  

Here are is the console output:

[_eventsObject]
  1. _eventsObject
  2. length0
  3. parentfunction (){return t._parent()}
  4. typefunction (e){var t,n,i,r=this,a=function(){return r};U.fn.init.call(this);for(n in e)t=e[n],"_"!=n.charAt(0)&&(i=ft.call(t),t=r.wrap(t,n,a)),r[n]=t;r.uid=L.guid()}
  5. __proto__Class.extend.i
^^^^^ This is the bad return, it should have a length of not 0

[U.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.initU.extend.init…]
  1. [0 … 99]
  2. [100 … 168]
  3. _eventsObject
  4. length169
  5. parentfunction (){return t._parent()}
  6. typefunction (e){var t,n,i,r=this,a=function(){return r};U.fn.init.call(this);for(n in e)t=e[n],"_"!=n.charAt(0)&&(i=ft.call(t),t=r.wrap(t,n,a)),r[n]=t;r.uid=L.guid()}
  7. __proto__Class.extend.i

^^^^^ This is the correct output it has all of my objects and their fields within each.

Any help is greatly appreciated, I am really stuck on this one.

Petur Subev
Telerik team
 answered on 12 Dec 2012
1 answer
198 views
Hi 

We are using two combobox with Cascading behaviour. 

We want both combo box to be enabled as they are cascade to each other. 

That is 

1 . Both should be enabled by default
2. If user selects Combobox 1, Combobox 2 should be filtered by value from combobox 1 
3. If user selects Combobox 2, Combobox 1 should be filtered by value from combobox 2 
4. Also always we need to show the  Place holder value 

I would appreciate if you help us on t his

Jaffar



Georgi Krustev
Telerik team
 answered on 12 Dec 2012
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
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
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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?