Telerik Forums
Kendo UI for jQuery Forum
3 answers
502 views

Hi, 
I'm working on MultiSelect + JSON as data source, i'm having issue to display the json result in Multiselect. 
It display to me as undefined.

Below is my multiselect code

            var multiselect = $("#ddlSelectCostCenter").data("kendoMultiSelect")
            var dataSource = new kendo.data.DataSource({
                data: [],
                pageSize: 500
            });
            multiselect.setDataSource(dataSource);
             
            if (result !== "") {
 
                dataSource = new kendo.data.DataSource({
                    type:"json",
                    data: JSON.stringify(result),
                    pageSize: 500              
                });
 
                multiselect.setDataSource(dataSource);
                multiselect.dataTextField = "Name";
                multiselect.dataValueField = "Value";
}

 

My Json is like below. 
[{"Value":"0000","Name":"ALL"},{"Value":"0111","Name":"0111 ~ Facility Management"},{"Value":"0113","Name":"0113 ~ NP Logistics Setup"},{"Value":"1001","Name":"1001 ~ TV KL Tec President Office"},{"Value":"2001","Name":"2001 ~ North Chip Engineering"},{"Value":"2002","Name":"2002 ~ TV AM CHIP"},{"Value":"2003","Name":"2003 ~ AutoMount Metecon"},{"Value":"2004","Name":"2004 ~ HM Office"},{"Value":"2005","Name":"2005 ~ BOARD BIZ-HM Office"},{"Value":"2006","Name":"2006 ~ Sony MFC Sys"},{"Value":"2007","Name":"2007 ~ AM North Oth"},{"Value":"2009","Name":"2009 ~ TV AM Office"},{"Value":"2010","Name":"2010 ~ AM North DISC"},{"Value":"2011","Name":"2011 ~ AM North CHIP"}]

What do I missed out?

Thank

 

 

Ivan Danchev
Telerik team
 answered on 16 Mar 2017
1 answer
405 views

Kendo Team,

Is there a way to make a row selectable, even if the user clicks on an non-editable row? From my perspective, it seems I need to utilize a click event handler on the grid and progammatically select the row. Is there an easier way?

As a follow up to a related issue, I noticed there are some performance issues in  IE with grids having many columns, particularly when the grid's selectable property is set. Do you have any more insight about this phenomenon? How do you think manually selecting the rows via the grid's click event will affect performance IE, assuming you know the deeper cause of IE's slow response with large grids?

 

Thank you..

Stefan
Telerik team
 answered on 16 Mar 2017
3 answers
419 views
Hi All,

I have a ui selection widget made up of a 1. radiobutton group, 2. kendoDropDownList, 3. Another kendoDropDownList

Each control is dependent on the latter. the dropdownlists have default dataitems  with "Select..." options.

I cannot get this to work because of the chain of events that are fired. I mean.. it works but change events are fired on databound which causes screwd up calls to the corresponding datasource read functions.

I need this sequence of events to happen.

1. User changes radiobuttongroup value
2. dropdownlist #1 ds read is called and result is bound
3. dropdownlist #1 is ENABLED and dataitem at index 0 is selected programmatically. dropdownlist #2 ds read is NOT called yet.
4. User changes dropdownlist#1 value, dropdownlist value#2 ds read is called
5.  dropdownlist #2 is ENABLED and dataitem at index 0 is selected programmatically. CHANGE EVENT for dropdownlist #2 IS NOT FIRED
6. User changes dropdownlist #2 and change event for it is fired.

If user selects new value from radiobuttongroup the following should happen. ddl#2 is disabled with dataitem at index 0 selected. NO EVENTS should be fired for ddl#2

Based on how the events work for both the datasource and the ddl i cannot make this work. I have observed strange behavior where changing the radiobuttongroup causes the next mouse click ANYWHERE on the page, including empty elements causes the change event of the ddl#1 is fired?? 

Is there some way to have a dropdownlists ds read be called without the dropdownlist's change event being fired??

Is there some way to programatically change the selected value/dataitem of the dropdownlist without the  the dropdownlist's change event being fired??

Thanks!




Ianko
Telerik team
 answered on 16 Mar 2017
2 answers
148 views
Hi Guys,

I have just tripped over a display issue when using frozen columns along with a toolbar.

To illustrate the problem please see the following dojo

http://dojo.telerik.com/okUSa

If you run this example and hit the 'refresh' button the toolbar gets moved down by 1px causing the display of a 2px border at the top and the removal of the bottom border.

With the 'locked' attribute commented out the toolbar remains static.

Investigations show the problem looks to be caused be the injection of the 'k-load-mask' div.

Without frozen columns this div gets inserted after the 'k-grid-content' div, but with frozen columns the div gets inserted before the 'k-grid-toolbar' div causing the unsightly display issue.

Regards
Alan
AGB
Top achievements
Rank 1
Iron
 answered on 16 Mar 2017
1 answer
131 views

I have copied the code from this example http://jsfiddle.net/yzKqV/159/ into a MVC view, the expand link is not working. the template for the master row is

<script id="rowTemplate" type="text/x-kendo-tmpl">
    <tr class="k-master-row">
        <td class="k-hierarchy-cell"><a href="\#" class="k-icon k-plus"></a></td>
        <td> ${FirstName} </td>
        <td> ${LastName} </td>
    </tr>
</script>

so the link for the href on my machine is https://localhost/# which is incorrect, not sure how to fix this link.

Any help would be greatly appreciated.

 

 

Konstantin Dikov
Telerik team
 answered on 16 Mar 2017
1 answer
120 views

hi 

i ma using k-rtl on spreadseet and the cells stay ltr. there is a wey to fix it?

Magdalena
Telerik team
 answered on 16 Mar 2017
1 answer
293 views

Hi,

 

I'm trying to get a diagram to generate a PDF file.

I've successfully persuaded it to output in landscape format using information from http://docs.telerik.com/kendo-ui/api/javascript/drawing/pdfoptionsbut I would also like to modify the output file's name and adjust other aspects of the output the code I'm, using is below:

function PrintDiagram() {
    var filename = jsonDiagram.Name.replace(/[^a-z0-9]/gi, '_').toLowerCase();
    findControl('input','EmpName').Value
    Telerik_Diagram.pdf = {
        creator: "Actis CRM",
        fileName: filename + '.pdf',
        subject: jsonDiagram.Name,
        title: jsonDiagram.Name,
        paperSize: "A4",
        landscape: true
    }
    Telerik_Diagram.saveAsPDF();
}

hopefully fairly self explanatory.

As I say the result is a diagram pdf that is correctly oriented but the file name is still the default 'export.pdf' and the pdf producer (I assume should map to 'creator) is still  Kendo UI PDF Generator v.2016.3.913. There is no title, author or subject either (see attached)

What am I doing wrong here?

 

Alan

 

Stefan
Telerik team
 answered on 16 Mar 2017
6 answers
277 views

hi:

my grid view data is using databound:

@model List<StockBetaVolatility>
@(Html.KendoGrid<StockBetaVolatility>()
            .Name("MainGridTable")
            .EnableCustomBinding(true)
            .Columns(columns =>
            {
                columns.Bound(p => p.TradeDate).Width(100);
                columns.ForeignKey(p => p.StockID, Shared.StockBaseNameList());
                columns.Bound(p => p.StockBeta);
                columns.Bound(p => p.StockVolatility);
            })
            .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Read(r => r.Action("AjaxRead", ViewContext.ControllerName())
                                                 .Data("PanelBarParameters"))
                                                 .ServerOperation(true)

            )
            .DefaultFormat()
            .Events(events => events.Change("GridMainSelect"))
)

 

in the browser is show B,

columns define:

 [DisplayName("stockβvalue")]
 public decimal StockBeta { get; set; }

how can i do?

 

Hubert
Top achievements
Rank 1
 answered on 16 Mar 2017
11 answers
1.0K+ views

I have a grid reading data from a SharePoint online list and one of the columns is a Choice type column that permits multiple values - maximum of 3 entries currently and unlikely to spread beyond 5. When getting the data using REST (getbytitle) the column comes back as a null if no item is selected or an object - collection of strings. I am using the template declaration within the grid column definition to use a function to extract the chosen items and concatenate them together into a comma separated list for display in the grid - see below:

{
    field: "BusinessDevelopmentProject",
    title: "Business Development Project",
    aggregates: ["count"],
    groupHeaderTemplate: "Project: #= GetBDProject(value)# - Count: #=count#",
    template: "<span>#= GetBDProject(BusinessDevelopmentProject) #</span>"
}

 

The function is as follows:

function GetBDProject(project) {
    if (project == null || project == undefined) return '';
    var projectString = '';
 
    for (var i = 0; i < project.results.length; i++) {
        projectString += project.results[i];
        if (i < (project.results.length - 1)) projectString += ', ';
    }
    return projectString;
};

 

This works perfectly for the column itself and when choosing to group by the column the grouping works OK and the grouping of those records with no project chosen is fine. But once I move to a page in the grid where the grouping changes to one with a value, so wants to group by it, the grid generates the following error and just sits with the loading graphic cycling permanently:

Uncaught SyntaxError: Unexpected identifier
    at Function (<anonymous>)
    at o.filter (kendo.all.min.js:11)
    at kendo.all.min.js:11
    at N (kendo.all.min.js:11)
    at o.select (kendo.all.min.js:11)
    at o.group (kendo.all.min.js:11)
    at Function.o.process (kendo.all.min.js:11)
    at init._queryProcess (kendo.all.min.js:11)
    at init.query (kendo.all.min.js:11)
    at init._query (kendo.all.min.js:11)

 

Is there something else I need to do to get the group header to work for a column with a function in for formatting?

 

Thanks in advance for any assistance.

PaulH
Top achievements
Rank 1
 answered on 15 Mar 2017
2 answers
195 views

I am using SPA with Kendo grid.  Can I apply different select color for different grid?  I tried to put the below style in my sub page.  But it will override my hosting page as well.  Thanks.

<style>
.k-grid .k-state-selected {
background-color: #cbf1e3 !important;
color: #000000;
}
.k-grid .k-alt.k-state-selected {
background-color: #cbf1e3 !important;
color: #000000;
}
</style>

Bertha
Top achievements
Rank 1
 answered on 15 Mar 2017
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
AICodingAssistant
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
+? 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?