Telerik Forums
Kendo UI for jQuery Forum
4 answers
9.1K+ views
Suppose I have know the rows selected in a grid
  grid = $('#myTable').data('kendoGrid');
  rows = grid.select();

and I know that I want the values from field 'abc'.

Without any apriori knowledge of the model how would I do something per this pseudo code:

for (row in rows) {
  i++;
  abcs[i] = row.valueof (field-abc)
}

The abcs would be used later as data of a transport.
Graham
Top achievements
Rank 2
Iron
Iron
 answered on 15 Dec 2016
1 answer
452 views
01.(function() {
02. 
03.jQuery(document).ready(function() {
04.    jQuery('#datepicker1').myKendoDatepicker({
05.        disabled: [new Date('12/25/2016').getTime(), 0, 6]
06.    });
07.});
08. 
09.jQuery.fn.myKendoDatepicker = function(options) {
10.    jQuery(this).each(function() {
11.        var dp = MyKendoDatepicker().init(this, options);
12.    });
13.    return this;
14.};
15. 
16.var MyKendoDatepicker = function(el) {
17.    return {
18.        defaults: {
19.            disableDates: function(date) {
20.                console.log(this);
21.                return date && (this.disabled.indexOf(date.getTime()) !== -1 || this.disabled.indexOf(date.getDay()) !== -1);
22.            },
23.        },
24. 
25.        init: function(el, options) {
26.            this.opts = jQuery.extend(true, this.defaults, options);
27.            return jQuery(el).kendoDatePicker(this.opts);
28.        },
29. 
30.    };
31.};
32. 
33.})();

I'm trying to create a wrapper that will allow us to set up default functionality for our datepicker. The previous code is just a simple starting point to illustrate my problem--I will be implementing more than just disabled dates. Unfortunately, I am not able to get a hold of my wrapper or even the actual input element once inside your "Datepicker" or "Calendar" objects (line 20). Any suggestions on how to accomplish my requirements? Am I missing something that would let me pass this object or grab the input the datepicker is acting upon (where I could place a reference to my object)?

thanks for you help.

david

Georgi Krustev
Telerik team
 answered on 15 Dec 2016
3 answers
174 views

If I select one file and upload it to .NET as List<HttpPostedFileBase>, the file HttpPostedFIleBase.FileName property, which includes the file's complete path, has what I would expect for escaped strings - double backslashes, for example C:\\FirstDir\\Foo.txt

 

But if I select multiple files and upload them, the files have double double (quadruple) backslashes:  C:\\\\FirstDir\\\\Foo.txt.

 

Is this known? Can anyone confirm?  From what I can tell the full paths are coming from .NET, not JavaScript or Kendo, but I want to be sure.

 

Thanks.

Dimiter Madjarov
Telerik team
 answered on 15 Dec 2016
1 answer
187 views

Hi,

Can you give me some advice on how to use angular translate inside of widget configurations?

Because ng-translate works async it seems ugly wrapper code is necessary like the one below.

 

Only the grid widget seems to support direct usage of translate like this:

...
                "columns": [
                    {
                        "title": "{{'Tenant.Users.UserTab.FirstName' | translate}}",
                        "field": "FirstName",
...

I couldn't get it working with other widgets. Am I missing an important detail?

 

$translate(['Core.Buttons.Ok', 'Core.Buttons.Cancel']).then(function(t) {
                $scope.colorOptions = {
                    buttons: true,
                    preview: true,
                    input: true,
                    messages: {
                        apply: t['Core.Buttons.Ok'],
                        cancel: t['Core.Buttons.Cancel']
                    }
                }
            });

 

<input kendo-color-picker ng-model="color1" k-options="colorOptions" />

 

 

Thanks a lot!

Stefan
Telerik team
 answered on 15 Dec 2016
1 answer
252 views

HI 
     I have an issue in kendo combobox I added a tooltip in kendo combobox dropdown list, the issue is when I click the tooltip in the combobox the dropdown was automatically closed. I want the when the tooltip dialog opens then the corresponding combobox dropdown list should not close. I am stuck in this issue help me out.
I used both the e.Preventdefault and e.stoppropagating but its not working. The following code that I used for the tooltip click event and I attached the screenshot of my issue.

comboBox.list.find('.info-MultiComboBox', '.cogInfo', 'cog-widget').click(function (e) {
// For some reason, this click event causes the dropdown to close. Calling preventDefault() stops this behavior.
e.preventDefault();
});

 

Dimiter Topalov
Telerik team
 answered on 15 Dec 2016
6 answers
1.3K+ views

I have a Kendo spreadsheet widget inside a Kendo window widget. On my screen I have 2 Kendo windows. There is a button to toggle between both windows being 50% height and 100% width, and 100% height and 50% width. I use a custom function here to size and align the windows.

The way I actually change the position is below:

myWindow.wrapper.css({
top: top,
left: left,
width: width,
height: height
});

 

However, when I do this, my spreadsheet components inside the windows are not resized. The spreadsheet div with the scrollbar is resized, but not the actual div which holds the spreadsheet cells (image attached).

 

Thanks!

Marc
Top achievements
Rank 1
 answered on 15 Dec 2016
2 answers
199 views

Hi, I have a custom function which opens 4 Kendo windows, inside a loop, one at a time. Each window has a Kendo spreadsheet component inside it already, populated with data. This crashes the browser and gives the following error:

 

angular.js:21778 RangeError: Maximum call stack size exceeded
    at s (kendo.all.js:103803)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103805)
    at s (kendo.all.js:103805)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103810)
    at s (kendo.all.js:103810)

 

Any ideas?

Marc
Top achievements
Rank 1
 answered on 15 Dec 2016
2 answers
121 views

I have read all the Threads having this type of discussion based on that I gave Model Id as well. Aslo tried function for Edit and Delete URLs. but no luck.

This code was working earlier after that I added two more grid (which is commented right now) after that all Edit/Delete started coming as operation = create.

 

Here is the code.

 

<script>
$m = jQuery.noConflict();
</script>

 

$m("#siteInspectiongrid").kendoGrid({
dataSource: {
error: function (e) {
var msg = e.xhr.responseText;
var String = msg.substring(msg.lastIndexOf(":") + 1, msg.lastIndexOf(";"));
document.getElementById('errorMessage').innerText = String + "!!";
},
transport: {
read: {
url: crudServiceBaseUrl + "/SiteInspectionInfo?userGroup=" + userGroupConfiguration,
dataType: "json"
},
update: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Update?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "PUT",
contentType: "application/json",
charset: "utf-8"
},
create: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Create?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "POST",
contentType: "application/json",
charset: "utf-8"
},
destroy: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Delete?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "DELETE",
contentType: "application/json",
charset: "utf-8"
},
parameterMap: function (options, operation) {
debugger;
if (operation !== "read" && operation !== "create" && options.models) {
return JSON.stringify({
'ReaderGroupID': options.models[0].ReaderGroupID,
'InspectionPercentage': options.models[0].InspectionPercentage,
'modifiedDate': options.models[0].modifiedDate,
'modifiedBy': options.models[0].modifiedBy,
'Active': options.models[0].Active,
'StaffType': options.models[0].StaffType,
'StaffTypeID': options.models[0].StaffTypeID
});
}
if (operation == "create" && options.models) {
return JSON.stringify({
'ReaderGroupID': options.models[0].readerGroupId.ReaderGroupID,
'InspectionPercentage': options.models[0].InspectionPercentage,
'createDate': options.models[0].createDate,
'createdBy': aliasName,
'modifiedDate': options.models[0].modifiedDate,
'modifiedBy': aliasName,
'StaffType': options.models[0].StaffId.StaffId,
'Active': options.models[0].Active
});
}
}
},
batch: true,
pageSize: 5,
schema: {
model: {
id: "Id",
fields: {
SiteCode: { editable: false, nullable: false },
SiteName: { editable: true, nullable: false },
ReaderGroup: { editable: true, nullable: false },
DoorRelay:{editable: true , nullable:false},
StaffType: { editable: true, nullable: false },
InspectionPercentage: { editable: true, nullable: true },
createdBy: { editable: false, nullable: true },
createDate: { editable: false, nullable: true },
modifiedBy: { editable: false, nullable: true },
modifiedDate: { editable: false, nullable: true },
Active: { editable: true, type: "boolean", defaultValue: true }
}
}
}
},
sortable: {
mode: "single",
allowUnsort: false
},
selectable: "multiple row",
pageable: {
buttonCount: 5
},
scrollable: false,
navigatable: true,
toolbar: [{ name: "create"
}],
edit: function (e) {
//======================================================
// Code to look for `hideMe` attribute on a column.
//======================================================
e.sender.columns.forEach(function (element, index /*, array */) {
if (element.hideMe) {
e.container.find(".k-edit-label:eq(" + index + "), "
+ ".k-edit-field:eq( " + index + ")"
).hide();
}
});
//======================================================
// End column hiding code
//======================================================
},
columns: [
{
field: "SiteCode",
title: "SiteCode",
hidden: true
},
{
field: "SiteName",
title: "SiteName"//,
// editor: siteDropDownEditor
},
{
field: "ReaderGroup",
title: "ReaderGroup"//,
//editor: readerGroupDropDownEditor//,
// template: '<a href="\\#" onclick="ReaderGroupDetails(#=ReaderGroupID# )">#=ReaderGroup#</a>'
},
{
field: "ReaderGroupID",
title: "ReaderGroupID",
hidden: true
},
{
field: "DoorRelay",
title: "DoorRelay",
hidden: true
},
{
field: "SearchRelay",
title: "SearchRelay",
hidden: true
},
{
field: "StaffType",
title: "StaffType"//,
// editor: staffDropDownEditor
}
,
{
field: "StaffTypeID",
title: "StaffTypeID",
hidden: true
}
,
{
field: "InspectionPercentage",
title: "Random %"
},
{
field: "createdBy",
title: "CreatedBy",
hideMe: true
}
,
{
field: "createDate",
title: "CreateDate",
hideMe: true
}
,
{
field: "modifiedBy",
title: "ModifiedBy",
hideMe: true
},
{
field: "modifiedDate",
title: "ModifiedDate",
hideMe: true
}
,
{ field: "Active", title: "Activated",
template: "<input type=\"checkbox\" #= Active ? checked='checked' : '' # class=\"check_row\"/>"
}
,
{ command: ["edit", "destroy"], title: "", width: 250 }
],
editable: {
mode: "inline"//,
// template: kendo.template($("#popup_editor").html())
}
});

Vladimir Iliev
Telerik team
 answered on 15 Dec 2016
6 answers
2.5K+ views

I'm populated the grid with a long running process.

I have this loop, it takes about 10 seconds to get 5 results, but let's say there are 20 results.

How do I add the 5 results to the grid and keep appending to it as the results come in?

I'm using asp.net mvc to get the data.

I saw someone ask this a while back, but was just wondering if this feature has been added or anything.

 

Thanks!

Ambrose
Top achievements
Rank 1
 answered on 14 Dec 2016
17 answers
4.4K+ views
Hi, Is there any way to provide or simulate OnFocus and OnBlur events for the Kendo DropDownList? I have an application where my customer wants a div that surrounds every user input field on a form highlighted as a user tabs through the fields.

It's not a problem with pure HTML input or select tags as I can use the blur and focus events for these elements to highlight the div surrounding the tag. The same approach also works with Kendo NumericTextBox or DatePicker widgets as they both include an embedded input tag.

However, I'm struggling to find a solution that would work for the Kendo DropDownList as it doesn't use a real select tag. I've tried adding focus/blur events to a div wrapping the DDL widget but it doesn't work that well as the user then has to tab through the dropdownlist twice.

Regards, Ian
Brad Fulton
Top achievements
Rank 1
 answered on 14 Dec 2016
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
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?