Telerik Forums
Kendo UI for jQuery Forum
6 answers
3.5K+ 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
182 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
1 answer
197 views

Hey.

Some of my grids have many columns. Is it possible to a-z sort columns before they are displayed in the column picker?

Best regards

Morten

Eyup
Telerik team
 answered on 16 Aug 2019
4 answers
28.2K+ views
How do I get the grid's selected row and its DataItem.?

After searching around since I couldn't find any sample from any of the Grid demo samples, I also consulted the documentation.
But still not clear on how to do it.

Do I need to subscibe to the change event?
.Events(events => events.Change("GSSelectionChange")

Or can I directly get the selected row and its DataItem like the following
var grid = $("#usersGrid").data("kendoGrid");
var selectedItem = grid.dataItem(grid.select());

So far, getting the selected row and its DataItem directly (w/out subscribing to the Change event) doesn't work.

I would appreciate any help or tip on how to get this done.














Tsvetomir
Telerik team
 answered on 16 Aug 2019
2 answers
283 views

Hi, 

How can I get the moveEnd to wait until a promise is resolved before ending completing?

Currently I have the following:

moveEnd: function(e) {
  if (!isEventValid(e.start, e.end)) {
    e.preventDefault();
    return false;
  }
 
  $.when(getAssistance(e.event, e.start, e.end))
    .done(function() {
      window.location = "/new-url";
    }).
    fail(function() {
      // 1
      e.preventDefault();
      return false;
    });
}

 

(I dont know how to get out of this editor)

My problem is that the 'moveEnd' completes before the promise is complete. If the Promise resolved and the user redirected, its a non-issue, but if the promise is rejected, the move needs to be prevented.

Please advise, Thanks,
Grant

Grant
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 16 Aug 2019
3 answers
600 views

Hey everyone,

We are currently trying out Kendo UI to see if it would fit our needs.
Spreadsheets are very important us, and we want to do something very specific with them.

We want to be able to merge multiple exported spreadsheets (output of saveJSON()), so that the first spreadsheet will be shown on top of the second spreadsheet, ...
We have looked through the developer documentation, but there does not seem to be a way to do it.
The problem is that there is no way to, in code, load/paste data at a specific row index.

If we were able to 'copy' and 'paste' in code, we might get somewhere, although that is still not ideal.

Use case: We want the user to create 'template' spreadsheets, which can later be combined in a single spreadsheet.
f.e.:

- User creates a 'header ' template spreadsheet with content like: Title, name, an image
- User creates a 'body' template spreadsheet specific information regarding ...
- User creates a new empty spreadsheet and loads the header template spreadsheet, and after that, the body spreadsheet.
- The header template will appear above the body spreadsheet.

If someone could help us with this, it would be very much appreciated.

 
Veselin Tsvetanov
Telerik team
 answered on 15 Aug 2019
1 answer
471 views

Hi,

 

This example shows a grid with empty cells when the datasource object didn't has data for the field.

There is a way to show a grid like the attached image with the same source used in the example above?

 

Thanks

 

 

Marin Bratanov
Telerik team
 answered on 15 Aug 2019
2 answers
799 views

OK, so I've been banging my head on this for a few days and I thought I was going in the right direction but maybe now.  So the problem I have is that browsers are auto-filling the filter box of the Kendo Grid with random information based on the user.  A lot of time it's an e-mail for some random reason.

So you can find threads about setting autocomplete="off" or AutoCompleteType="Disabled" for kendo objects.  So I tried this:

{
                field: "ToFromOrganizer",
                title: "From/To/Organizer",
                filterable: {
                    cell: {
                        template: function(args) {
                            args.element.kendoMaskedTextBox({
                                value: "",
                                AutoCompleteType: "Disabled"
                            });
                        },
                        operator: "contains",
                        suggestionOperator: "contains"
                    }
                }
            },

 

In an attempt to prevent the browser from filling in the field, but that doesn't work.  Anyone have an suggestions.

 

Alex Hajigeorgieva
Telerik team
 answered on 15 Aug 2019
2 answers
4.5K+ views
I know from the documentation and other threads that if I want the columns in the grid to auto size, then I have to set "scrollable" to false.  Setting scrollable to false gives me the desired effect in terms on column width, but having the grid scrollable is also a requirement in my case (the column headers must stay visible).

My questions are:

1. Is there a way to auto size the columns and keep the grid scrollable?
2. If not, are there plans to add this feature in the future (column auto size and scrollable at the same time)?

Regards,
Victor
Viktor Tachev
Telerik team
 answered on 15 Aug 2019
1 answer
400 views

Hey Everyone,

We are currently testing Kendo spreadsheet to see if it fits our needs.
We have an excel file that we open, and after that export to excel (with the default toolbar buttons, and without changing anything).

The following error occurs:

TypeError: e[n.image] is undefined     kendo.all.js:12698:32
    n kendo.all.js:12698
    map self-hosted:291
    drawingsXML kendo.all.js:12692
    toZIP kendo.all.js:13080
    toBlob kendo.all.js:13176
    r kendo.all.js:136776
    onload kendo.all.js:136755

 

If I look at the json (generated by saveJSON), I do see some drawing definitions in there, without a reference to an image.
If I look at the excel file, I do not see something strange.

Atteched you will find the excel file, and the json file.

Can I do something to fix this error ?

Thanks in advance


 
Petar
Telerik team
 answered on 14 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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?