Telerik Forums
Kendo UI for jQuery Forum
3 answers
156 views
Hi, 

I am creating a grid using row templates with custom upload and download buttons for individual rows.These buttons are anchor links with their class set to k-button. I am attaching a click handler to these buttons using the jquery delegate function. My code runs fine in chrome but when I try it ie9 nothing happens when I click the buttons. The weird thing is if start developer tools (by pressing F12) everything starts running fine. Can anyone explain what may be causing this issue. I am using the jquery.js files provided with kendo.

Code excerpts for reference as shown below
<!-- HTML code -->
<table id="grid">     
    <thead>
        .....
    </thead>            
</table> 

<script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr >
        ..
        <td>                        
            <a id="delete" class='k-button' data-event="delete"><span class='k-icon k-delete'>Delete</span></a>
            <a id="download" class='k-button' data-event="download"><span class='k-downloadicon'>Download</span></a>                                </td>
    </tr>
</script>

 <script type="text/javascript">

    $(function () {        
        $(document).ready(function () {
            
            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        ...
                    },                    
                    destroy: {
                        ...
                    }
                },                
                ....
            });

            $("#grid").kendoGrid({
                dataSource: dataSource,                
                rowTemplate: kendo.template($("#rowTemplate").html()),
                ...
            });

            $(document).delegate(".k-button", "click", function (e) {
                var that = $(this),
                eventData = that.data("event");
                if (eventData != null) {
                    _clickHandlers[eventData](e);
                }
            });


            _clickHandlers = {


                "delete": function (event) {
                    console.log("delete");
                    ....
                },
                "download": function (event) {
                    console.log("download");
                    .....
                } 
            }

        });
    });
</script>


Joel
Top achievements
Rank 1
 answered on 16 Feb 2012
0 answers
105 views
I thought I'd offer a potential solution to a problem that took me awhile to solve.  Perhaps the Kendo team will consider exposing a method that will make this easier in the future.

I have a search form with a text field and two radio buttons.  The radio buttons are labelled "User ID" and Username."  The user searches for other users in the system by selecting the appropriate criteria by which to search (userid or username) and typing their text in the field.  What I wanted was to provide autocomplete suggestions that pertained to the search criteria.  So if the user has selected Username, the suggestions will be a list of usernames.

Here's how I did it.

JSON pseudo-code of datasource
suggestions: {
   userIds: [],
   userNames: []
}

$(document).ready(function ()
{
    $(":radio").bind('click', setAutoComplete);
    initSuggestions();
}

var initSuggestions = function()
{
    suggestionDS.one('change', function()
    {
          // suggestions is a global variable allowing us to hit
        // this datasource only once.
        suggestions = suggestionDS.data();
        $("#textField").kendoAutoComplete( suggestions.userIds );        
    });
    suggestionDS.read();
}

var setAutoComplete = function()
{    
    // Grab a reference to the autoComplete
    var ac = $("#textField").data("kendoAutoComplete");
    
    // Remove all of its suggestions
    ac.options.dataSource.splice(0, ac.options.dataSource.length);
    
    // Get the correct array based on the user's radio button selection
    var arr = $(":radio:checked").val() == "userIds" ? suggestions.userIds : suggestions.userNames;
    
    // Push all of the elements onto the autocomplete's datasource.
    for( x in arr )
    {
        ac.options.dataSource.push(arr[x]);
    }
}
Sean
Top achievements
Rank 1
 asked on 16 Feb 2012
3 answers
702 views

I have two pages.

The parent: /Main/Home.aspx

The child modal: /Main/MoveJob.aspx

The modal window is a simple form with a Submit button.  The parent opens modal window. When the modal window’s submit button is pressed, the browsers URL is incorrectly redirected to the modal window’s URL.

Parent’s Code is as follows:

     <!-- Define the HTML table, with rows, columns, and data -->
     <table class="jobsGrid">
      <thead>
          <tr>
              <th data-field="title">Job #</th>
              <th data-field="Type">Type of Project</th>
              <th data-field="Desc">Description</th>
              <th data-field="Brand">Brand</th>
              <th data-field="Milestone">Next Milestone</th>
              <th data-field="Location">Job Location</th>
              <th data-field="Sub">Submitter</th>
              <th data-field="move"></th>
          </tr>
      </thead>
      <tbody>
    
          <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
            <tr>
              <td><%# Eval("JobID")%></td>
              <td><%# Eval("JobTypeName")%></td>
              <td><a href="#"><%# Eval("JobName")%></a></td>
              <td><%# Eval("BrandName")%></td>
              <td>coming soon</td>
              <td><%# Eval("LocationName")%></td>
              <td><%# Eval("SubmitterName")%></td>
              <td><a href="javaScript:;" data-url="../Main/MoveJob.aspx" title="Move Job" class="moveLink" data-id="<%# Eval("JobID")%>">Move</a></td>
            </tr>
            </ItemTemplate>
          </asp:Repeater>
      </tbody>
     </table>
 
        <div class="moveWindow">
        </div>
 
 
 
<script type="text/javascript">
    function refreshGrid() {
        //alert("I will try to refresh the grid");
        var grid = $(".jobsGrid").data("kendoGrid");
        grid.refresh();
    }
 
    //MOVE WINDOW
    $(document).ready(function () {
 
        $(".jobsGrid").kendoGrid();
 
        $(".moveLink").click(function () {
            var id = $(this).data("id");
            var href = $(this).data("url") + "?jobId=" + id;
            var title = $(this).attr("title");
            var myWin = $(".moveWindow");
 
            if (!myWin.data("kendoWindow")) {
                // window not yet initialized
                myWin.kendoWindow({
                    width: "auto",
                    height: "auto",
                    modal: true,
                    resizable: true,
                    title: title,
                    content: href
                });
            } else {
                // reopening window
                myWin.data("kendoWindow")
                .content("Loading...") // add loading message
                .center()
                .refresh(href) // request the URL via AJAX
                .open(); // open the window
 
            }
 
            return false;
        });
    });
 
 
 
 
</script>

Jeremy
Top achievements
Rank 1
 answered on 16 Feb 2012
5 answers
158 views
Hi,

Your site's login is not compatible with www.lastpass.com and that makes the use of your site very inconvenient.  Do you have plans to use something more compatible for your credentials popup?

Thanks!

PS: Using Safari on a Mac with latest LastPass for Safari.
Georgi Tunev
Telerik team
 answered on 16 Feb 2012
6 answers
168 views
Hi!

KendoUI is fantastic, however one problem. I am trying to set a custom template on a column chart for its tooltip, however it seems to be unable to find the fields specified.

Datasource:
var usageData = @Html.Raw(@ServiceStack.Text.JsonSerializer.SerializeToString(Model.ParkingStats));

Code:
$('#chart-utilization').kendoChart({ 
    title: {
        text: "Parking utilization for week"
    },
    dataSource:{
        data: usageData[0].Usage
    },
    series:[{
        type: "column",
        field: "Max",
        name: "Max utilization"
    }],
    categoryAxis:{
        field: "Week"
    },
    tooltip: {
        visible: true,
        template: "${ Max } of ${ Capacity }"
    },
    legend: {
        visible: false
    }
});

The 'Max' and when changed 'Capacity' renders correct columns. But the template can't find either fields and throws a NullReferenceException.


Thanks in advance for your pro-tips ;-) !

Finest regards.
Alexander Valchev
Telerik team
 answered on 16 Feb 2012
0 answers
113 views
Hi,

I would like to know how to display no record not found while using the KENDO grid. Assuming there are not data in the db.

Regards,
Arsene
Top achievements
Rank 1
 asked on 16 Feb 2012
1 answer
163 views
I like behavior of Panel Bar in your demos (http://demos.kendoui.com/web/overview/index.html). Injecting content, persisting selected panelbar item etc. Is there source code? In Kendo download pack is this part of demo simplified.

Thank you.

Zdenek
Kamen Bundev
Telerik team
 answered on 16 Feb 2012
1 answer
333 views
I need to be able to get to the url that is called by the grid after filtering, sorting operations. It would be great if you would expose the url parser that is currently internal so i can use it to save history for browser back operations.
Dimo
Telerik team
 answered on 16 Feb 2012
6 answers
359 views
Hi,

I'm having trouble initializing the menu control from JSON. Using the code from the example:

$(document).ready(function() {
 $("#menu").kendoMenu({
  dataSource: [
   {
    text: "Menu Item 1",
    items: [
     { text: "Sub Menu Item 1" },
     { text: "Sub Menu Item 2" }
    ]
   },
   {
    text: "Menu Item 2"
   }
  ]
 })
});

The menu doesn't show up. I have tried this using <ul id="menu"></ul> as well as <div id="menu"></div> thinking that maybe it had to be an unordered list, but I can't make it work.

When I check the generated page, I can see that there is some kind of attempt to create the menu, but the items from the JSON aren't populated. As seen in web inspector:

<ul id="menu" class="k-widget k-reset k-header k-menu k-menu-horizontal"></ul>
Sameer
Top achievements
Rank 1
 answered on 16 Feb 2012
0 answers
211 views
Using the jQuery plugin: http://www.appelsiini.net/projects/lazyload causes some quirks. If you don't specify a container for the plugin, only the visible images on the screen are loaded, scolling down on a splitter pane shows that any other that were not originally visible are not loaded.

Specify the ID of the pane with the scrollbars + images causes them to all load at once. Changing the pixel threshold does not fix this either.

Has anyone else managed to get images to lazy load with any jQuery plugin with a scrollable splitter pane?
Gabriel
Top achievements
Rank 1
 asked on 16 Feb 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
DropDownTree
ListBox
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?