Telerik Forums
Kendo UI for jQuery Forum
7 answers
205 views

I have a multiSelect and want to have paste to select, nut some times I am getting this error, 

Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.

function ParsePaste(inputSent) {

try {

//console.log($(CtrlName).data("kendoMultiSelect").dataSource.data().length);
var originalArray = $(CtrlName).data("kendoMultiSelect").value();
var pidArray = inputSent.val().trim().replace(/\s*,\s*|\s*;\s*|\s+/g, ",").split(",");

if (originalArray.length >= 1) {
for (var i = 0; i < originalArray.length; i++) {
pidArray.push(originalArray[i]);
console.log(pidArray);
}
}
inputSent.val("");
setTimeout(function () {
try {
$(CtrlName).data("kendoMultiSelect").value(pidArray);
} catch (ex) {
alert('try again!');
console.log(ex); 
}
setTimeout(function () {
try {
var newArray = $(CtrlName).data("kendoMultiSelect").value();
Array.prototype.diff = function (a) {
return this.filter(function (i) { return a.indexOf(i) < 0; });
};
if (pidArray.diff(newArray).length > 0) { aeriesWin.prototype.alert(pidArray.diff(newArray) + " not found!"); }

} catch (ex) { alert('try again!'); }
}, 250);

}, 200);
} catch (ex) {
//alert("2:" + ex);
alert('try again!');
}
}


$(function () {

$(document).on('paste', '.k-multiselect-wrap input:visible', function (e) {

setTimeout(function (e) {

ParsePaste($('.k-multiselect-wrap input:visible'));
}, 50);
});

$(document).on('keyup', '.k-multiselect-wrap input:visible', function (e) {

if (e.which == 13) {
var originalArray = $(CtrlName).data("kendoMultiSelect").value();
 originalArray.push($(this).val());
setTimeout(function () {
$(CtrlName).data("kendoMultiSelect").value(originalArray);
}, 250);
}

});
// $("#" +  ).siblings("div").find("input[aria-owns^=" +msStudents+"]").keyup(function (e) {
//if (e.which == 13) {
//alert('xxx');
//}

//});

})

Mina
Top achievements
Rank 1
 answered on 23 Aug 2019
3 answers
466 views

Hello, 

We are using a donut chart and have a problem with truncated labels, as explained below. 

Here are the chart settings:
type: 'donut',
holeSize: 76,
size: 10,
startAngle: 150,
labels: {
distance: 1,
margin: 0,
position: 'outsideEnd',
visible: true,
align: 'circle',
background: 'transparent',
font: `600 12px/12px Assistant,Helvetica Neue,Helvetica,Arial,sans-serif;`,
color: '#474E7A',
template: "#= kendo.toString(dataItem.percent, '\\#\\#,\\#.\\#') + '%\\n' + dataItem.category #"
},
connectors: false,
visual: e => {
const width = 18;
const space = 6;
const group = new kendo.drawing.Group();

const A = (Math.PI - Math.acos(((width / 2) + space) / 2 / e.radius) * 2) * 180 / Math.PI;

const geometry = new kendo.geometry.Arc([ e.center.x, e.center.y ], {
radiusX: e.radius - width / 2,
radiusY: e.radius - width / 2,
startAngle: e.startAngle + A,
endAngle: e.endAngle - A
});

const arc = new kendo.drawing.Arc(geometry, {
stroke: {
color: this.colorChart,
width: width,
lineCap: 'round',
lineJoin: 'round'
}
});

return group.append(arc);
},
highlight: {
visible: false
}
}

 

Our textual is RTL and some of the categories have long text titles.
For this reason we updated our dataItem.category so if the text it too long we will split it to two lines using \n
However there are still cases where the text exceeds the edge of the chart area - see for example the two lines marked in the attached image. 
In those two lines, the first line string length is 11 but actually only the first 8 characters are rendered (you can only see half of the 9th letter). The second line string length is 18 and only 10 is visible.


1) Can you advise us of a better way to handle the truncated labels text? For example we have no problem with using “…” at the end of the string when text is too long, but we are not familiar with a built in mechanism to do so
2) As you can see our template concatenates the dataItem.percent, new line (\n) and dataItem.category. We would like to use a different font styles so dataItem.percent will have one style and dataItem.category will have a different font size and color. How can we achieve this?

Thanks,

Ron.


Alex Hajigeorgieva
Telerik team
 answered on 22 Aug 2019
4 answers
850 views

Hi,

I am trying to show validation error message on the grid (for example if the start date is greater than end date)- https://dojo.telerik.com/OjAnEJoV/2 Can you please help? Thanks in advance

Nikolay
Telerik team
 answered on 22 Aug 2019
1 answer
197 views

Hello all ;)

When I Maximize the window I zoom in on the page, but I can not change the position TOP 

maximize: function(e) {
     var scale = 'scale(1.3)';
document.body.style.webkitTransform =       // Chrome, Opera, Safari
 document.body.style.msTransform =          // IE 9
 document.body.style.transform = scale;
 dialog.center();
 
  },

 

Dimitar
Telerik team
 answered on 21 Aug 2019
1 answer
137 views
Hi All,

I have implement Column menu filtering in Grid, but facing one issue in that:

Issue:

- When user clicks / touch (for tabs / smartphones), column and filter drop-down will open sometime on left and sometimes on right of the main drop-down.
- And as per our observation on first click /  touch it works fine but on next clicks it will shifting the position.
- Also for some devices it works fine and for some devices it wont.
- And because of that behavior user not able to perform any action when its open.

Please check the attached screen shots.

Quick help will be appreciated ..!!

Thanks
Preslav
Telerik team
 answered on 20 Aug 2019
6 answers
478 views

Hello Everyone,

I am facing problem in implementing the kendo alert functionality.

In my page I am using kendo grid which is working perfectly. But when I am trying to use kendo alert, javascript error comes "kendo.alert is not a function". Below is a part of the code.

kendo.ui.progress($('#myGridDiv'), true);
            $.ajax({
                url: '<%=ResolveUrl("~/ReportDataService.asmx/GetReportData") %>',
                data: "{'Office':'" + Office + "','Team':'" + Team + "','Client':'" + Client + "','FileNo':'" + FileNo + "','BillNo':'" + BillNo + "'}",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d.length > 0) {
                        var grid = $('#myGridDiv').getKendoGrid();
                        grid.dataSource.data(data.d);
                        grid.refresh();
                    }
                    else {
                        kendo.alert('No results found. Displaying last searched results.');     //--> Error comes from here. If no record is found for the grid.
                    }
                    kendo.ui.progress($('#myGridDiv'), false);
                },
                error: function (error) {
                    alert("Error: " + JSON.stringify(error));
                    kendo.ui.progress($('#myGridDiv'), false);
                }
            });

The scripts that I am using are

<link rel="stylesheet" href="Styles/kendo.common.min.css" />
    <link rel="stylesheet" href="Styles/kendo.default.min.css" />
    <link rel="stylesheet" href="Styles/kendo.default.mobile.min.css" />
<script src="Scripts/jquery.min.js"></script>
    <script src="Scripts/jszip.min.js"></script>
    <script src="Scripts/kendo.all.min.js"></script>

Can somebody please help.

Thanks & Regards

Viktor Tachev
Telerik team
 answered on 20 Aug 2019
5 answers
6.5K+ views
I made a simple example here using local data. Notice that the refresh button when clicked puts refreshed called. but refreshing is only output on the initial load. 
http://jsbin.com/ohumul/3/edit

$('#refresh').button().click(function(){
    $('body').prepend('refresh called.<br/>');
     
    var grid = $("#grid").data("kendoGrid");
       
      grid.refresh();
       
   
   
  });
Mallika
Top achievements
Rank 1
 answered on 19 Aug 2019
6 answers
606 views
Hello,

I am using KENDO UI with IFRAME and I want to display an alert when the user clicks to close his WEB browser when the IFRAME is active with KENDO.

Thank you in advance :)
Aleksandar
Telerik team
 answered on 19 Aug 2019
6 answers
3.4K+ views
Hello,

I'm using the following javascript method to remotely bind a datasource. I am trying to pass the "headers" array to the web service
function changeColumns() {
    var headers = new Array();
     
    $("#columns").children().each(function () {
        if ($(this).attr("checked") == "checked") {
            headers.push($(this).attr("id"));
        }
    });
 
    var grid = $("#GridTest").data("kendoGrid");
    var ds = grid.dataSource;
    grid.columns = [];
    grid.thead.remove();
    ds.data({
        transport: {
            read: {
                url: controller + "Test_Read",
                dataType: "json",
                data: { headers: headers }
            },
            parameterMap: function (options) {
                return kendo.stringify(options);
            },
            type: "json"
        },
        pageSize: 10,
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true
    });
 
    $("#GridTest").kendoGrid({
        dataSource: ds,
        scrollable: true,
        sortable: true,
        reorderable: true,
        resizable: true
    }).data("kendoGrid");
}

At runtime, the headers parameter in the web service method (shown below)  is of type object. If I specify a type other than object in the method signature (eg: string[] or string), then headers is null.
public ActionResult Test_Read([DataSourceRequest] DataSourceRequest request, object headers = null)
{
    return Json(GetProductsDynamic(headers).ToDataSourceResult(request));
}

Can anyone help me get the values I'm sending in the format it was sent?
Thanks!

Edit: After looking in firebug, my POST parameters being sent are :
"sort=&page=1&pageSize=10&group=&filter="
So it seems the data isn't being sent at all.
Michael
Top achievements
Rank 1
 answered on 16 Aug 2019
1 answer
180 views
Hello, im simulating having a datasource by generating the data with javascript and binding that to a datasource object in kendo. Could this be the issue for the false positives on column C? Im also open to other suggestions on how can i color cells  depending on their value with datasource binding
Example: https://dojo.telerik.com/UcAFowEP/3
Veselin Tsvetanov
Telerik team
 answered on 16 Aug 2019
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
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
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?