Telerik Forums
Kendo UI for jQuery Forum
3 answers
142 views
Hi.

Suppose I have something like this: http://jsfiddle.net/3mJJm/27/.

Select draw a rectangle on a map, select some area and click validate.
There will be exception: Uncaught TypeError: Object #<SVGAnimatedString> has no method 'indexOf'

For now the only possible workaround I found is added guard condition for SVGAnimatedString:
_findMessageContainer: function(fieldName) {
            var locators = kendo.ui.validator.messageLocators,
                name,
                containers = $(),
                children = this.element[0].getElementsByTagName("*");
 
            for (var idx = 0, length = children.length; idx < length; idx++) {
                var element = children[idx];
                 
                                              //added code
                if(element.className instanceof SVGAnimatedString) continue;
                 
                if (element.className.indexOf(INVALIDMSG) > -1) {
                    var attr = element.getAttribute(kendo.attr("for"));
                    if (attr === fieldName) {
                        containers = containers.add(element);
                    }
                }
            }


Is there more robust workaround?

Thanks in advance.

Rosen
Telerik team
 answered on 24 Feb 2014
1 answer
189 views
I have a Kendo Grid where and only one of the columns is editable and that column has a template.  The template is: 
  '<input type="text" class="grid-input" value="#=Percentage#" />'
where Percentage is the dataSource column name.

Since the text boxes are visible for all rows (desired L&F), how do I make sure any changes in those text boxes result in the dataSource being updated?

Thanks in advance,
--Ed
Alexander Popov
Telerik team
 answered on 24 Feb 2014
2 answers
167 views
Hi,

I want to use a stacked bar chart to display

* a set value for every month (grey)
* a "current value" for every month (blue)
* the difference between set and current value (either green for a positive result or red for a negative result)

moreover I would like to display the percentage of the discrepancy above the bar charts (either +30% or -40%)

however I didnot find any way to fix this problem.

the idea would be to add a "label" property to the data source of the difference value - but it seems that I can only use the value base for the bar as label :(

Any ideas how to get the difference percentage displayed for each month on top of my bars?

Thanks in advance
CHris
Iliana Dyankova
Telerik team
 answered on 24 Feb 2014
11 answers
3.8K+ views
Hi All,

I have a ListView object in my page that is linked to a DataSource(contains name and ID), and formatted with a Kendo Template object. A user is going to select one of the items in the list, then I need to capture the Selected Item's ID from the data source. I cannot figure out how to do this properly

I figured out how to get the Selected Item from a drop down list.
var id = $("#dbdropdownlist").data("kendoDropDownList").value().toString();

But I cannot figure out how to do something similar with the ListView object. I assume I want to use the 'Select()' method, but that returns an HTML object(I assume from the template), which means that I have to search through child objects and stuff...seemd too complicated.

Any one have an idea of how to accomplish what I have outlined above? Any help would be appreciated.
Greg

OS: Windows 7
Browser: Chrome 17.0.963.83
Kendo UI Beta v2012.1.229 
jQuery JavaScript Library v1.7.1  
Nikolay Rusev
Telerik team
 answered on 24 Feb 2014
1 answer
154 views
I have to Colour a Column based on its value after searching sometime found this solution which worked well in firefox. but in other browsers its causing the grid to lose all the rows.

Here is my grid
@(Html.Kendo().Grid<EDENEMS.WEB.Models.AccountModel>()
        .Name("Accountsgrid")
        .Columns(columns =>
        {
            columns.Bound(c => c.AccountName).ClientTemplate("<a class='GridLink' href='" + Url.Action("AccountView", "Accounts", new { Id = "#=AccountID#" }) + "'>#=AccountName#</a>").Width(180);
            //columns.Bound(c => c.AccountName).Width(180);
            columns.Bound(c => c.FullAddress);
            columns.Bound(c => c.AccountType).Width(120).ClientTemplate("#=Getcoloured(AccountType)#");
            columns.Bound(c => c.PhoneNumber).Width(100);
            columns.Bound(c => c.EmailAddress).Width(150);

        })
        .HtmlAttributes(new { style = "height: 355px;" })
        .Scrollable()
        .Sortable()
        .Filterable()
        .Selectable()
        //.Events(e=>e.DataBound("onDataBound"))
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Accounts_Read", "AccountsGrid"))
        )
    )

this is the function 
function Getcoloured(value) {
        if (value && value != null && value.contains('A') == 1)
            return "<span style='color:#00B067'>" + value + "</span>";
        else if (value && value != null && value.contains('B') == 1)
            return "<span style='color:#4F81BD'>" + value + "</span>";
        else if (value && value != null)
            return "<span style='color:#B366C0'>" + value + "</span>";
        else 
            return ""
    }

Is there any other way to achieve Colouring a column based on the value.

Dimiter Madjarov
Telerik team
 answered on 24 Feb 2014
6 answers
852 views
Hi, 

i have a view that is a special case and i dont want it to have scolling if the content of the view is longer than the viewport. 

its just a view with a header and footer and some content and its being wrapped by scrollwrapper. 

whats the best way to disable it, something like overflow:hidden;
Kiril Nikolov
Telerik team
 answered on 24 Feb 2014
1 answer
165 views
Our requirements for a batch grid include showing the textboxes in every grid cell all of the time, not just when a user tabs into a specific cell. I've tried dummying up my own styles to no avail. Is there a more elegant way like rowtemplates where we can just show the textbox in every cell all the time? 

I have attached a picture as an example of what we are looking for.
Atanas Korchev
Telerik team
 answered on 24 Feb 2014
1 answer
553 views


I find the kendoui chart has two methods :refersh method and redraw method,what is the difference?I think both of them is to draw the chart again. But if the chart is binding from remote data according to ajax,the request will not fire again.

$("#Chart").data("kendoChart").redraw();
$("#Chart").data("kendoChart").refresh();
I have a situation,at first I have a page which is to draw a chart with autobind from remote data,Now I want to add a line in this chart,it means I have to change the datasource( add the line data to the datasource),Which method should I use best?I find use refresh or redraw method are both OK.
T. Tsonev
Telerik team
 answered on 24 Feb 2014
1 answer
158 views
hi there,
I've been trying to pass a model to a partial view that is accessed by a kendo tabstrip. but I cant get it to work. is this even possible?

here is my view

@(Html.Kendo().TabStrip()
        .Name("tabsStrip")
        .Items(items =>
        {
            items.Add()
                .Encoded(false)
                .Text("Computer <span class='k-state-active'></span>")
                .Content(Html.Partial("_Computer", ComputerModel).ToHtmlString())  -> is there a way to pass the computer model to the partial view?                
               .Selected(true);
            items.Add()
                .Encoded(false)
                .Text("User <span></span>")
                .Content(Html.Partial("_User").ToHtmlString());      
        }))
Daniel
Telerik team
 answered on 24 Feb 2014
3 answers
1.4K+ views
Hi

I can add buttons to a command column in a grid and trigger click events fine. What I want to do now is add a command button to my row template

In the row template I have

#if (IsMe) {# <a class="k-button k-grid-delete">Delete</a> #} #

And then in my document ready function I have

$("#grid").on("click", ".k-grid-delete", function () {
              alert("click delete command");
          });

This works and the message appears whenever I click on one of the delete buttons, however what I want to do when the user clicks is make an ajax call that deletes the item from its ID property....

When using a command column I would do something like

function delete(e) {
          e.preventDefault();
 
          var dataItem = this.dataItem($(e.currentTarget).closest("tr"));

i could then use dataItem.ID to reference the ID of the relevant row.

How can I do this for the button I have created above in the row template?

Many thanks


Huw Lloyd
Top achievements
Rank 1
 answered on 24 Feb 2014
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?