Telerik Forums
Kendo UI for jQuery Forum
1 answer
283 views
A touch event can be handle by:

<img id="login-badge" src="..." data-role="touch" data-hold="didTapHold"/>

How can do use binding to connect this to a object's method?  Something akin to the following:

<img id="login-badge" src="..." data-role="touch" data-bind="???: viewModelDidTapHold"/>

Thanks.
Alexander Valchev
Telerik team
 answered on 17 Jul 2013
1 answer
102 views
Life Cycle question

I have a standard grid on a page. The grid has templates that generate some Html.

I try to modify the html the grid generated with jQuery in the Document Ready function, but the elements are not there when I attempt the blow javascript. I am guessing I am trying to early in the life cycle? If so, how do I modify internal html elements using jQuery? Note that if I manually run the script in FF's FireBug after the page is all ready, it works fine.
 
$(function () {
           $("a.subLinkMadeInAGrid").click(function () {
               //Do something with this item
           });
Dimo
Telerik team
 answered on 17 Jul 2013
1 answer
93 views
I have a large number (100+) of grids in my application.  May of which are bound to <table> elements via the use of the data-field attribute on the headers of the table.  The tables all scroll.  What I'd like to do now is specify the width of just a few columns in each table, these are mainly columns that the fixed table layout makes too wide, columns containing just icons or block of colour designating a status of some sort.  I have tried the following...

- Adding a width to the header column - unfortunately the header styles don't get copied to data table so we end up with the headers being the correct size but the data columns not lining up

- Adding a colgroup with widths to the table - this does seem to work in isolation, the colgroup gets copied between the two tables, however, when this method is used inside the Durandal spa framework the colgroup is not yet in the DOM when Kendo does it's thing and is therefore not picked up

- Adding the columns property to the initialisation of the grid in js and specifying width there - this always works, however, doing this for all of my grids, none of which specify the columns property currently, is a much bigger overhead than I'd like and it presents a maintenance headache going forward (plus, I'd rather not specify styling in js)

- Adding a data-width to the th and adding this to the columns collection on dataBinding or dataBound - This doesn't seem to work which is a shame as adding a simple event handler to each grid that picks up on a data attribute, much like the data-field attribute we already use would be a perfect solution in many ways.

I think the dataBinding or dataBound solution may be the way to go, I'm just not sure how to re-size columns in either of those event handlers.  I've  created a small fiddle with which I've been experimenting and any guidance would be greatly appreciated.

 
Dimo
Telerik team
 answered on 17 Jul 2013
1 answer
148 views
Hey,

I have an observable object looking something like this:

1.viewModel = kendo.observable({
2.    anArray: ['item1', 'item2', '...'],
3.    filteredArray: function() {
4.        return this.get('actions').filter(function (el) {
5.            return someLogic(el);
6.        });
7.    }
8.});
So far so good. No I want to use this filtered array in a source binding (to generate a table, say) and I want to to the following:

1.<script id="row-template" type="text/x-kendo-template">
2.    <tr>
3.        [...]
4.        <td><select data-bind="source: availableDescriptions, value: Description"/></td>
5.    </tr>
6.</script>
Where availableDescription is an array contained in my viewModel.
This generates an error (Uncaught TypeError: Object [object Array] has no method 'parent' )

Apparently kendo is resolving 'availableDescriptions' by calling 'parent()' on the observable array that is the context for my template. To work around this I changed my implementation of filteredArray to look like this:

1.filteredArray: function () {
2.    var a = this.get('actions').filter(function (el) {
3.        return doSomething(el);
4.    });
5.    a.parent = function () { return this; };
6.    return a;
7.}
It works, but isn't particularly graceful. Is there a better way to do this ?
Alexander Valchev
Telerik team
 answered on 17 Jul 2013
1 answer
146 views
Hi, Foreign key columns in the grid are not being grouped by text rather by foreign key id. Any recommendations as to how can we group by text of the foreign key col.

Thanks
Vladimir Iliev
Telerik team
 answered on 17 Jul 2013
3 answers
167 views
I have created a list view and when you click on one of the objects it opens a further details page.
This works ok except that the button on the details page is only showing text.
The following is an example so if you click on one of the objects in the list view the next page the word Website should be a button.
http://jsbin.com/edaciy/1
The following is the code
http://jsbin.com/edaciy/1/edit
Thanks.
Kiril Nikolov
Telerik team
 answered on 17 Jul 2013
2 answers
85 views
Everything on my grid is working great except when they click update and then cancel they get an error. "Unexpected number"

Here is the code. the functions applist, companylist, etc just populate the edit dropdowns. They seem to be generaign find though. Any ideas?

var crudServiceBaseUrl = "main.php?a=quote_detail", dataSource = new kendo.data.DataSource({
    transport : {
        read : {
            url : crudServiceBaseUrl + "&read=1",
            dataType : "json"
        },
        update : {
            url : crudServiceBaseUrl + "&update=1",
            dataType : "json",
            complete: function(e) {
                        $("#grid").data("kendoGrid").dataSource.read();
            }                   
        },
        destroy : {
            url : crudServiceBaseUrl + "&destroy=1",
            dataType : "json"
        },
        create : {
            url : crudServiceBaseUrl + "&create=1",
            dataType : "json",
            complete: function(e) {
                        $("#grid").data("kendoGrid").dataSource.read();
            }                   
        }
    },
    batch : true,
    pageSize : 10,
    serverPaging : true,
    serverFiltering : true,
    serverSorting : true,
    
    schema : {
        data: "data",
        total: "total",
        model : {
            id : "ID",
            fields : {
                company : {
                    validation : {
                        required : true
                    }
                },
                effective_date : {
                    validation : {
                        required : true
                    }
                },
                fee : {
                    validation : {
                        required : true
                    }
                },
                guarantee : {
                    validation : {
                        required : true
                    }
                },
                state : {
                    validation : {
                        required : true
                    }
                },
                application : {
                }
            }
        }
    }
});
 
$("#grid").kendoGrid({
    dataSource : dataSource,
    pageable : true,           
    height : 430,
    refresh: true,           
    toolbar : ["create"],
    columns : [{
        field : "company",
        title : "Company",
        editor: companyList
    }, {
        field : "effective_date",
        title : "Effective Date"
    }, {
        field : "fee",
        title : "Fee"
    }, {
        field : "guarantee",
        title : "Guarantee"
    }, {
        field : "state",
        title : "State",
        editor: stateList
    },
    {
        field : "application",
        title : "Application",
        editor: appList           
    },
    {
        command : ["edit", "destroy"],
        title : " ",
        width : "160px"
    }],
    editable : "inline"
});
Kiril Nikolov
Telerik team
 answered on 17 Jul 2013
4 answers
1.1K+ views
Hi,

I wish to create a combobox which when user enter 3 character
then the data source retrieve filtered data from server with the POST variable of keyword.

But i cant make the data source retrieve new data with combobox text, here is my code:

                var combo=$("#input_customer").kendoComboBox({
                dataTextField: "title",
                dataValueField:"entry_id",
                filter:"contains",
                minLength: 3
            }).data("kendoComboBox");
 
            var customer_ds=new kendo.data.DataSource({
                transport: {
                    read: {
                        type:"POST",
                        dataType: "json",
                        serverFiltering:true,
                        data:{keywords:combo.text()},
                        url: "ajax/customer"
                    }
                }
            });
 
            $("#input_customer").data("kendoComboBox").setDataSource(customer_ds);

Alexander Valchev
Telerik team
 answered on 17 Jul 2013
1 answer
119 views
Having an issue with data binding and click events being fired multiple times.

I have a master view object that binds data to a view on init.

View.prototype.init = function (e)
{
this.id = e.view.id;
this.elm = e.view.element;
this.view = e.view;
        
this.view.bind('show', this.show.bind(this));
this.view.bind('hide', this.hide.bind(this));
        
kendo.bind(this.elm, this.data, kendo.mobile.ui);
};

For some reason click events are being fired twice.
Petyo
Telerik team
 answered on 17 Jul 2013
1 answer
143 views
Using the layout template where I have the following markup

<div data-role="navbar">
    <a class="nav-button" data-align="left" data-transition="slide:left" data-role="backbutton">Back</a>
    <span data-role="view-title"></span>
    <a data-align="right" data-role="button" data-transition="slide:left" class="nav-button" href="#tabstrip-home">Home</a>
</div>
if you select the back button the first time the page loads you get Uncaught TypeError: Cannot call method 'split' of undefined - I guess as there is nothign to go back to, how can I disable this button until there is something to go back to?
Petyo
Telerik team
 answered on 17 Jul 2013
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?