Telerik Forums
Kendo UI for jQuery Forum
3 answers
793 views
To a listview with pictures, I attach a tooltip to every picutre and want to ajax load the tool tip content.

ToolTip:
var tooltip = $("#lvPictures").kendoTooltip({
    filter: "img.imgInfo",
    width: 120,
    position: "top",
    autoHide: false,
    content: function (e) {
        var target = e.target;
        var fileId = target.data('identity');
        return helpers.GetPictureToopTip(fileId);
    }
}).data("kendoTooltip");
The helper function:
var helpers =
{
    GetPictureToopTip: function (fileId) {
        helpers.GetFile(fileId).done(function (json) {
            var jsonObj = JSON.parse(json.d);
            var html = '';
            html += '<div>Picture info</div>'
            html += '<div>' + jsonObj.FileName + '</div>'
            return html;
        });
    }
}
Ajax call is fired just fine and returns data, however, the tool tip is show without content.

What am I doing wrong?
Dimo
Telerik team
 answered on 01 Apr 2013
3 answers
225 views
I have some issue related to the template for combobox.

My combobox has template defined:
<script id="Items_template" type="text/x-kendo-template">
${data.NameLang}(${data.Code})
</script>

This is the definition of combobox:
 @(Html.Kendo().ComboBox()
                      .Name("Item_Description")
                      .DataTextField("NameLang")
                      .DataValueField("NameLang")
                      .Filter(FilterType.Contains)
                      .DataSource(action => action.Read(read => read.Action("GetItemsForPAByName", "StockCount")))
                      .Value(Model.Item_Description)   
                      .HtmlAttributes(new {style="width:240px"}) 
                      .TemplateId("Items_template")
                      )
As a result on the list I get undefined(undefined).
Same definition and template not located on the custom grid editor is working fine.

Is this some issue with combobox styling ?
Is there any workaround ?
Petur Subev
Telerik team
 answered on 01 Apr 2013
1 answer
186 views
I would like to suggest a simple upgrade to "Insert hyperlink". It would be great if you would split out the prefix from the address and have a selector that allows the user to choose website, email, or phone.

Selector: Website/Email/Phone
Address:sales@kendoui.com
Text: Kendo UI
Tooltip: Click Here
Open Link in new window: Yes

Results:
<a href="http://www.kendoui.com">Kendo UI</a>
<a href="mailto:sales@kendoui.com">Kendo UI</a>
<a href="tel:8883652779">Kendo UI</a>

Dimiter Madjarov
Telerik team
 answered on 01 Apr 2013
13 answers
656 views
I am trying to bind data from asp.net data control(data table) to Kendo UI Grid.
but i don't know how to bind data in grid using datasource
& what should i give input parameter to datasource method of Kendo UI Grid.

Does we have any other way to bind data other than JSON ?

Please explain me with example.
 
gowtham
Top achievements
Rank 1
 answered on 01 Apr 2013
1 answer
535 views
 Hi,

I'm migrating a project from ASP.NET MVC Extensions to KendoUI. I'm trying to figure out the best way to re-create this grid binding using KendoUI and without any serverside code. I can't find anything to do with onRowDataBound or similar in the documentation.

As you can see, as each row is databound, it attaches the countdown jquery plugin (http://keith-wood.name/countdown.html) and uses the current dataItem's Due datetime value.

Is the only way to do this using javascript inside the <script id="rowTemplate" type="text/x-kendo-tmpl"> element?

How can I recreate this to work with KendoUI?
function onRowDataBound(e) {
 
     e.row.cells[2].innerHTML = "<span class='countdown-" + e.dataItem.SONumber + "'></span>"
 
     if (e.dataItem.Due != null && e.dataItem.Due < new Date(2015, 4, 1) && e.dataItem.Due > new Date(2011, 4, 1)) {
         $('.countdown-' + e.dataItem.SONumber).countdown({
             until: new Date(Date.parse(e.dataItem.Due)), compact: true,
             layout: '<strong>{dn} {dl} {hnn}{sep}{mnn}{sep}{snn}</strong>',
         });
     }
 
 
 }

This is sample output for one row once it has been rendered:
<tr style="background: none repeat scroll 0% 0% rgb(255, 134, 112);">
   <td>43475</td>
   <td>New</td>
      <td>
         <span class="countdown-43475 hasCountdown">
            <strong>0 d 00:00:00</strong>
         </span>
      </td>
   <td>Account</td>
   <td>Description</td>
   <td>Cons</td>
   <td class="t-last">P3 - 24H</td>
</tr>
Thanks
RGTech
Top achievements
Rank 1
 answered on 01 Apr 2013
2 answers
151 views
When I have a ModalView open and change the orientation of my iPad, the ModalView is no longer centered.  How do I get it to re-center? I assume I need to bind on the orientationchange event, but I don't know what code I can use to re-center.

     $(window).bind('orientationchange', reCenter);

     function reCenter() {
          // unknown recenter code??
     }

Thank you,
Jason
Jason
Top achievements
Rank 1
 answered on 30 Mar 2013
3 answers
190 views
For a specific reason I'd like to use my kendo mobile app also through desktop browser (webkit). Is there a way to enable mouse wheel scrolling of my views?
Yrjo
Top achievements
Rank 1
 answered on 30 Mar 2013
1 answer
122 views
Are you planning to support sliders and pickers in KendUI Mobile anytime soon? Is there any workaround or any good third party widget you use to add a slider range? I tried with <input type="number">, but it's ugly.

Thanks for the information.
Iliana Dyankova
Telerik team
 answered on 29 Mar 2013
1 answer
240 views
Hello all,

I am trying the detail template today and I have the detail template for my parent grid (pasted below).   The CustomerNumber is coming from the parent grid and I am getting my read result set just fine.  The issue is the parameters I need such as "DocID" you will below are coming up undefined.   Those params are in the model for the template I have DocumentModel.   How do I pass those params from the detail template model versus the parent model?

<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
.Name("tabStrip_#=CustomerNumber#")
.SelectedIndex(0)
.Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
.Items(items =>
{
items.Add().Text("Attachments").Content(@<text>
@(Html.Kendo().Grid<ABC.DataModel.Document.DocumentModel>()
.Name("grid_#=CustomerNumber#")
.Columns(columns =>
{
columns.Bound(p => p.DocumentType).Width(40).Title("Type").ClientTemplate("#=RenderImage(data)#");
columns.Bound(p => p.DocumentName).ClientTemplate(@Html.ActionLink("#=DocumentName#", "DownloadFile",
new { ID = "#=DocID#", fileRef = "#=FileRef#", fileName = "#=DocumentNameExt#" }).ToHtmlString());
columns.Bound(p => p.ModifiedDate).Title("Modified");
columns.Bound(p => p.ModifiedBy).Title("Modified By");
columns.Bound(p => p.LatestVersion).Title("Latest Version");
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("CustomerAttachments_Read", "Customer", new { library = "#=CustomerNumber#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate())
</text>
);
})
.ToClientTemplate())
</script>
Sean Bornstein
Top achievements
Rank 1
 answered on 29 Mar 2013
3 answers
534 views
Thank you all in advance for your assistance. I am new to Kendo and trying to work my way through some event examples. I have two questions.

For my scenario I have an array of items that I am binding to a treeview. Each data item looks like this...
[{"id": 24820, "parentId": 0, "title": "Kendo", "target": "_blank", "href": "http://www.kendoui.com", "active": true, "hasChildren": false}, ...]

Questions #1: Can I access data elements of a node on a select event?

Question #2: Is there a way to cancel page change onSelect? e.preventDefault() does not seem to work for me.

I am trying to use the data above and onSelect determine if the "target" is set to "_blank". If it is, I want to execute an open new window and prevent the current page from changing. If not, I want the normal logic to run.

Sample Code:
<div id="menu" class="k-content">
    <div id="treeview"></div>
</div>
<script type="text/javascript">
    var data = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "api/menu",
                type: "GET",
                dataType: "json",
                contentType: "application/json"
            }
        },
        schema: {
            model: {
                id: "id",
            }
        }
    });
 
    function onSelect(e) {
        var targetIsBlank = false;
        // TODO: Check e.node passed and determine if "target" is "_blank"
        if (targetIsBlank) {
            // TODO: open new window with target and href properties
            e.preventDefault(); // this doesn't work when dataUrlField is set
        }
    }
 
    $("#treeview").kendoTreeView({
        dataSource: data,
        dataTextField: "title",
        dataUrlField : "href",
        select: onSelect,
    });
</script>
zhao
Top achievements
Rank 1
 answered on 29 Mar 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
Application
Drag and Drop
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?