Telerik Forums
Kendo UI for jQuery Forum
2 answers
351 views

Hi,

 

I want to use a multiselect widget inside of a grid. The applicaton is Angular 1.6 with typescript.

The model consists of a comma separated string.

 

Problem: the widget is opened and initialized with the correct values. But when I change the widget these modifications do not update the model.

 

This is what I've got so far:

module kendo.data.binders.widget {
    export class commaseparatedvalue extends kendo.data.Binder {
 
        init(widget, bindings, options) {
            kendo.data.Binder.fn.init.call(this, widget.element[0], bindings, options);
        }
 
 
        refresh() {
            // this is called correctly!
            console.log("refresh", this.bindings, this.element);
            var that = this;
            var value = that.bindings["commaseparatedvalue"].get();
            var values = value ? value.split(",") : [];
            that.element.value(values);
        }
 
        change() {
            // this is not called
            console.log("change", this.bindings, this.element);
        }
 
 
 
    }
}

 

 

any help greatly appreciated!

 

Thank you!

Dimitar
Telerik team
 answered on 10 Jan 2018
5 answers
204 views
Hi,
It must be mentioned somewhere but I just can't find one. Can you tell how to group my custom created tool buttons A and B together with no gap, like "bold" and "italic" buttons are grouped together?
Regards,
Ivan Danchev
Telerik team
 answered on 10 Jan 2018
1 answer
5.9K+ views

Hello,

I have a TreeList with a nullable date field to be displayed.  The following line adds the field to my Treelist:

    columns.Add().Field(e => e.LastUsed).Format("{0:MMMM d, yyyy}"); 

If the date field has a value, then the date is displayed.  If it is null, the word "null" is displayed.  I would like to be able to display either a custom text string like "N/A" or a blank, instead of the word "null".

I also don't want to convert the Treelist to all javascript. 

Thank you very much for your assistance.

Dave

Stefan
Telerik team
 answered on 10 Jan 2018
7 answers
620 views

I'm diagramming some product structures with 50-100 parts (3 levels). Rendering is taking about a minute (sometimes longer) in IE11 and sometimes the page is dying. If I break, it's always in kendo.all.min.js.

 

Does this sound right? It seems slow...

 Attaching a picture of a typical diagram and my initial code. I'm using Kendo UI v2015.2.902

 

 

 

<div id="diagram" style="width: 100%; height: 800px;">
    @(Html.Kendo().Diagram()
          .Name("diagram")
          .DataSource(dataSource => dataSource
               .Read(read => read.Action("_GetParts", "Diagram", new { partId = Model.PartId, level = Model.Level }))
               .Model(m => m.Children("Children"))
          )
 
          .Editable(false)
          .Layout(l => l
            .Type(DiagramLayoutType.Tree)
            .Subtype(DiagramLayoutSubtype.Tipover)
            .HorizontalSeparation(10)
            .VerticalSeparation(10)
        )
        .ConnectionDefaults(cd => cd
            .Stroke(s => s
                .Color("#bbb")
                .Width(1)
            )
             
    .Editable(false)
          )
          .ShapeDefaults(sd => sd
              .Visual("visualTemplate")
          )
 
          .Events(e => e.Select("onClick"))
<script type ="text/javascript">
    function visualTemplate(options) {
        var dataviz = kendo.dataviz;
        var g = new dataviz.diagram.Group();
        var dataItem = options.dataItem;
        var imageLink = "../../Content/images/cc/" + dataItem.CommCode + ".png";
        var lc = dataItem.Lifecycle;
 
        if (lc == null) {
            lc = "?";
        }
 
        if (dataItem.IsParentLevel) {
 
 
            g.append(new dataviz.diagram.Rectangle({
                width: 400,
                height: 50,
                stroke: {
                    width: 1,
                    color: "#000"
                },
                fill: {
                    color: "#efefef"
                }
            }));
 
            g.append(new dataviz.diagram.Image({
                source: imageLink,
                x: 10,
                y: 3,
                width: 16,
                height: 16
            }));
 
 
 
            g.append(new dataviz.diagram.TextBlock({
                text: dataItem.PartNum,
                x: 32,
                y: 3,
                color: "#000",
                fontSize: "14"
            }));
 
            g.append(new dataviz.diagram.TextBlock({
                text: dataItem.ItemDesc,
                x: 12,
                y: 28,
                color: "#000",
                fontSize: "9"
            }));
 
            g.append(new dataviz.diagram.TextBlock({
                text: lc,
                x: 300,
                y: 3,
                color: "#000",
                fontSize: "9"
            }));
 
            g.append(new dataviz.diagram.Rectangle({
                width: 4,
                height: 50,
                fill: dataItem.DiagramColor,
                stroke: {
                    width: 0
                }
            }));
 
        } else {
            g.append(new dataviz.diagram.Rectangle({
                width: 120,
                height: 36,
                stroke: {
                    width: 1,
                    color: "#000"
                },
                fill: {
                    color: "#efefef"
                }
            }));
 
            g.append(new dataviz.diagram.Image({
                source: imageLink,
                x: 10,
                y: 3,
                width: 16,
                height: 16
            }));
 
            g.append(new dataviz.diagram.TextBlock({
                text: dataItem.PartNum,
                x: 32,
                y: 3,
                color: "#000",
                fontSize: "10"
            }));
 
            g.append(new dataviz.diagram.TextBlock({
                text: dataItem.ShortDesc,
                x: 10,
                y: 23,
                color: "#000",
                fontSize: "8"
            }));
 
            g.append(new dataviz.diagram.Rectangle({
                width: 3,
                height: 36,
                fill: dataItem.DiagramColor,
                stroke: {
                    width: 0
                }
            }));
        }
        return g;
    }
</script>
    )
</div>

Stefan
Telerik team
 answered on 10 Jan 2018
16 answers
828 views

I am trying to filter a Kendo UI Grid based on Kendo UI DatePicker date but getting this error: "Error: Unable to get property 'dataSource' of undefined or null reference". As shown below, I am trying to pass the selected date as a parameter to the controller of the Kendo Grid. 

 

Below is my View:

@model RainfallReporting.Models.RainFallData

@{
    ViewBag.Title = "RainFall Data";
}

<h2>Daily RainFall Data</h2>
<div class="container">
    <div class="row">
        <p></p>
        @(Html.Kendo().DatePicker()
            .Name("rfallDate")
            .Events(e => e.Change("onChange"))
        )
        <p></p>
        @(Html.Kendo().Grid<RainfallReporting.Models.RainFallData>()
            .Name("rfallGrid")
            .AutoBind(false) 
            .Selectable()
            .Columns(columns =>
                                {
                                    columns.Bound(c => c.RecordNo);
                                    columns.Bound(c => c.TimeStamp).Title("RainFall Date").Format("{0:dd-MM-yyyy}");
                                    columns.Bound(c => c.BattVolts_Min);
                                    columns.Bound(c => c.LoggerTemp_Min);
                                    columns.Bound(c => c.LoggerTemp_Max);
                                    columns.Bound(c => c.Rainfall_Tot);
                                    columns.Bound(c => c.Total);
                                }
             )
            .DataSource(datasource => datasource
                .Ajax()
                .PageSize(100)
                .Model(model =>
                {
                    model.Id(rfall => rfall.RainFallDataId);
                    model.Field(rfall => rfall.RainFallDataId);
                }
                )
                                .Read(read => read.Action("GetRainfall_ByDate", "RainFall").Data("additionalData"))
            )

            //Set grid sortable
            .Sortable()

            //set grid selectable
            .Selectable()

            //set grid pagable
            .Pageable(pageable =>
                                {
                                    pageable.Refresh(true);
                                    pageable.PageSizes(true);
                                }
            )
        )

        <script>
            function additionalData(e) {
                var value = $("#rfallDate").data("kendoDatePicker").value();
                return { selectedDate: value }; // send the filter value as part of the Read request
            }

            function onChange() {
                var grid = $("rfallGrid").data("kendoGrid");
                grid.dataSource.read(); // rebind the Grid's DataSource
            }
        </script>

    </div>
</div>

This is my controller that returns data for the Kendo UI Grid:

 

 public class RainFallController : Controller
    {
        private RAINFALLDBEntities db = new RAINFALLDBEntities();

 public ActionResult GetRainfall_ByDate([DataSourceRequest]DataSourceRequest request,DateTime selectedDate)

        {
            try
            {
               
                var query = from c in db.RainFallDatas
                            where c.TimeStamp == selectedDate
                            select c;
                query.ToList();

                DataSourceResult output = query.ToDataSourceResult(request);
                return Json(output, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(ex.Message);
            }
        }

    }

 

John
Top achievements
Rank 1
 answered on 10 Jan 2018
4 answers
211 views

Hello,

I have written the code to transfer an element in the source listbox by double clicking on it as follows

function RegisterTransfer(ctrlId)
{
    var listBox = $("#" + ctrlId).data("kendoListBox");
    listBox.wrapper.find(".k-list").on("dblclick", ".k-item", function (e) {
        listBox._executeCommand("transferTo");
    });
}

this works fine.
But, I am unable to achieve the reverse scenario.

viz; I can't transfer an element in the destination listbox back to the source listbox by double clicking on it.
Any help would be appreciated!

Thanks, 
Niranjan

Niranjan
Top achievements
Rank 1
 answered on 09 Jan 2018
2 answers
438 views

Hi,

when I use trigger select in combobox it is fired twice and the second time it is fired the item property comes to null.

Has anyone had a similar problem and can you help me?

Thank you.

BR,

MCosta

 

Marco
Top achievements
Rank 1
 answered on 09 Jan 2018
2 answers
193 views

My co-workers are forcing me to include all the little kendo JS files separately rather than just using "all". 

This is rather difficult since kendo.spreadsheet.js has dependencies, but I don't know what they are. Currently I am stuck on kendoColorPalette. No idea which JS file to include. 

Does anyone know which of the JS files to include (in what order) to be able to use Spreadsheet?

Thanks!

Neli
Telerik team
 answered on 09 Jan 2018
1 answer
186 views

Hi,

I have implemented a popover which is called from a tab-strip element. The popover opens when the tab-strip element is clicked on and does not close when it is clicked again. While debugging I found out the popover open() is called after the close(), data-close is not been called.

The popover closes when we click anywhere outside the popover.

Thank you,

Ivan Danchev
Telerik team
 answered on 09 Jan 2018
2 answers
938 views

I want kendo drop down list to be filterable by user typing but the data source is from my angularjs.  I could only find example with server filtering.  I tried to add filterable="true" but not sure what else need to add.  Thanks.

<select id="fac" kendo-drop-down-list style="width: 260px" filterable="true"
k-option-label="' Choose Region or Home '"
k-data-text-field="'FacilityName'"
k-data-value-field="'FacCode'"
k-data-source="facilityList"
k-on-change="facilityChange(kendoEvent)"
data-ng-model="selectedfacility"></select>

Bertha
Top achievements
Rank 1
 answered on 08 Jan 2018
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
ContextMenu
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
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?