Telerik Forums
Kendo UI for jQuery Forum
3 answers
1.4K+ views

Hi,
My issue is simple, I have a normal HTML Dropdown List or <select> list. I am using the following code to convert it to Kendo Drop Down

$(document).ready(function () {
            $(".mySelect").kendoDropDownList();

 }

It works, but the alignment is not good. When I open the dropdown list to choose the Items, the list is a little bit moved to the right of the base-button. 

Here is the screenshot

Click Here For Screenshot
Iliana Dyankova
Telerik team
 answered on 27 Apr 2012
4 answers
487 views
I would love to see an example of a grid bound to a viewmodel. When the user selects a row in the grid the details of the row are shown below the grid in input fields. If you edit one of the fields the grid will automatically update. Have anyone done anything like this? Can you please create a jsfiddle demonstrating it for me? I have not been able to find something like this, but I belive it is a very common thing to do.
Bjarke
Top achievements
Rank 1
 answered on 27 Apr 2012
1 answer
417 views
I'm evaluating this product for my organization and to be honest I'm very new to this stuff. I've been playing around with stuff for a couple of days but I appear to have become stuck on something pretty trivial.

I'm calling an ASP.NET web service using VS 2010. I'm calling it from the dataSource, and then binding the dataSource to the chart. It works fine when I don't try to pass parameters, I get the results into the chart and everything seems right. The Kendo definition of the datasource is

                    var dsprov = new kendo.data.DataSource({
                        schema: {
                            data: "d"
                        },
                        transport: {
                            read: {
                                url: "IndustryTrends.aspx/ChartData",
                                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                                type: "POST"
                            }
                        }
                    });


And the definition of the web service is

<WebMethod()>
    Public Shared Function ChartData() As IEnumerable(Of BolIndustryChartDataItem)
        Dim c As New List(Of BolIndustryChartDataItem)
        c.Add(New BolIndustryChartDataItem("My name", 3,4,5))
        Return c
    End Function



...this all works fine.

But now I want to add a parameter to the read function in order to be able to read the correct data. I assumed that all I had to do was change the dataSource definition to:

   var dsprov = new kendo.data.DataSource({
                        schema: {
                            data: "d"
                        },
                        transport: {
                            read: {
                                url: "IndustryTrends.aspx/ChartData",
                                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                                type: "POST",
data: { 
name: function() {
return "michael";
} }


                            }
                        }
                    });

....and then change the web service to 

<WebMethod()>
    Public Shared Function ChartData(byval name as string) As IEnumerable(Of BolIndustryChartDataItem)
        Dim c As New List(Of BolIndustryChartDataItem)
        c.Add(New BolIndustryChartDataItem("My name", 3,4,5))
        Return c
    End Function


....but this causes the web service to never get called. I know I missing something trivial here but I'e spend some time looking at it, tried a bunch of different things, and I can't figure out what.

Thanks!
Vivek
Top achievements
Rank 1
 answered on 27 Apr 2012
1 answer
87 views
Is there a way to turn off a widget once it has been applied?

So if I have a case like: 

$(this).kendoGrid(...)

I need to turn it off for a certain case. Is that possible?

Dimo
Telerik team
 answered on 27 Apr 2012
0 answers
106 views
Hi, I'm new to kendo and I downloaded kendo web and found no upload example on the examples/index.html.  Where can I find it please?  Thanks.

Update: Got it working, though still didn't see it as part of the examples folder.  Thanks.
ray
Top achievements
Rank 1
 asked on 26 Apr 2012
6 answers
316 views
Hello,

I'm currently trying to create a variable that will be used as a grid DataSource.  When I create a typeless variable, this is working perfectly.... however, if I cast my variable as a kendo.data.DataSource, the grid doesn't work anymore.

Here's my code:
var myDataSource = {
    schema: {
        model: {
            id: "RecordID",
            fields: {
                RecordID: { editable: false, nullable: true },
                FirstName: { editable: true },
                LastName: { editable: true }
            }
        }
    },
    type: "odata",
    serverPaging: true,
    serverSorting: true,
    pageSize: 100,
    batch: false,
    transport: {
        read: "http://localhost:1625/Data/GetPatients",
        create: { url: "http://localhost:1625/Data/Create", contentType: "application/json; charset=utf-8", type: "POST" },
        update: { url: "http://localhost:1625/Data/Update", contentType: "application/json; charset=utf-8", type: "POST" },
        destroy: { url: "http://localhost:1625/Data/Destroy", contentType: "application/json; charset=utf-8", type: "POST", dataType: "json" },
        parameterMap: function (data, operation) {
            if (operation !== "read") {
                return kendo.stringify(data);
            } else {
                return kendo.data.transports["odata"].parameterMap(data, operation);
            }
        }
 
    }
 
 
};
 
var myDataSource2 = new kendo.data.DataSource({
    schema: {
        model: {
            id: "RecordID",
            fields: {
                RecordID: { editable: false, nullable: true },
                FirstName: { editable: true },
                LastName: { editable: true }
            }
        }
    },
    type: "odata",
    serverPaging: true,
    serverSorting: true,
    pageSize: 100,
    batch: false,
    transport: {
        read: "http://localhost:1625/Data/GetPatients",
        create: { url: "http://localhost:1625/Data/Create", contentType: "application/json; charset=utf-8", type: "POST" },
        update: { url: "http://localhost:1625/Data/Update", contentType: "application/json; charset=utf-8", type: "POST" },
        destroy: { url: "http://localhost:1625/Data/Destroy", contentType: "application/json; charset=utf-8", type: "POST", dataType: "json" },
        parameterMap: function (data, operation) {
            if (operation !== "read") {
                return kendo.stringify(data);
            } else {
                return kendo.data.transports["odata"].parameterMap(data, operation);
            }
        }
 
    }
 
 
});
 
$(document).ready(function () {
    $("#grid").kendoGrid({
        dataSource: myDataSource, //This is working but if you change it to myDataSource2, then it doesn't work
        height: 500,
        scrollable: {
            virtual: true
        },
        editable: true,
        sortable: true,
        toolbar: ["create", "save"],
        columns: ["RecordID", "FirstName", "LastName", { command: "destroy"}]
    });
});

As mentionned in the code, myDataSource is working but not myDataSource2.

Am I missing something here?

Best regards,

Simon



Simon
Top achievements
Rank 1
 answered on 26 Apr 2012
5 answers
312 views

$("#shortList").kendoGrid({

            height: 400,

            columns: [{

                field: "name",

                title: "Name"

            }],

            dataSource: {

                data: [

                    {

                        name: "Test"

                    }]

            }

        });


then I get this exception when trying to add a row using API later:
TypeError: 'undefined' is not an object (evaluating 'this._set.indexOf')


$("#shortList").data("kendoGrid").addRow();

Using the latest commercial version of your software.  How do I add a row using API?

Joshua
Top achievements
Rank 1
 answered on 26 Apr 2012
1 answer
108 views
Hello,

I have a grid that when an item is selected, it changes an image based on the selected data item.

The code firing on the change event is as follows:

function showSelectedImage() {
 
                    var grid = $("#grid").data("kendoGrid");
 
                    //var data = grid.dataItem(grid.select());
 
                    grid.select().each(function () {
                        var data = grid.dataItem($(this));
                        if (null != data) {
                            $("#documentPreview").attr("src", data.ImageUrl);
                            $("#documentPreview").attr("alt", data.DocumentId);
 
                            $("#documentView").attr("src", data.ImageUrl);
                            $("#documentView").attr("alt", data.DocumentId);
 
 
 
                            $("#openImageHyperLink").attr("href", data.ImageUrl);
 
 
                            if ($("#documentPreview").is(":hidden")) {
                                $('#documentPreview').slideDown("slow", "easein", null);
 
                            }
 
                            if (null != data.ExtraPageUrls) {
                                buildPager(data.ExtraPageUrls);
                            }
                        }
                    });
 
                     
                }

This code works fine on an un-grouped grid.  However, when grouping is enabled, when you click an item in the second group, the data item return is the next one in the list, rather than the current one.  If you click the preceding group footer, you get the data item for the first item in the next group.

It is as if the group footer is bound to a data item, messing up the sequence......

E.G:

SUPPLIER NAME GROUP HEADER
DATA 1
DATA 2
SUPPLIER NAME GROUP FOOTER
DATA 3
DATA 4

-----

Clicking Data 3 row returns DATA 4 data item.

Clicking SUPPLIER NAME GROUP FOOTER returns DATA 3 Data Item

HELP!!!!!
Rosen
Telerik team
 answered on 26 Apr 2012
2 answers
99 views
I am using a grid that has inline editing enabled. If it Edit the grid, but then hit cancel instead of update, it caused the row to be removed.

I have reproduced this in the following JSFiddle: http://jsfiddle.net/sFaUp/1/ 
If you hit edit, then cancel, the row gets removed.

This seems like a bug to me, however its possible I have something configured incorrectly. Could I receive some help with this?

Thanks!
Kyle
Top achievements
Rank 1
 answered on 26 Apr 2012
0 answers
196 views
Hi guys
This is no doubt an incredibly stupid question and I'll probably not be able to articulate it properly, but here goes...

I'm trying to integrate kendo web ui into an aspx page that returns data in an html table at runtime.  I have no control over any datasource, I can only return data into an html table, data surrounded by tr and td tags when the page loads, obviously I'm hoping kendo can add sorting, pagination and filtering.  I can get a basic sort but pagesize and height etc don't work.  I'm not sure whether I should be calling a datasource at some point within the initialisation (though the sort works without)

I can build a basic html table

<table id="grid">
<thead>
<th data-field="name">Name</th>
<th data-field="reference">Reference</th>
<th data-field="type">Type</th>
</thead>
<tbody>

add then add in the report which returns all the data within TR and TD tags

and then use the basic initialisation  like so..

<script>
$(document).ready(function(){
      $("#grid").kendoGrid({
         groupable: true,
         scrollable: true,
         sortable: true,
         pageable: true
      });
  });
            </script>

and it returns one very long sortable table (my sample data is hundreds of rows) with the page number 1 in the footer

what do I need to add to get a smaller size and split the data into multiple pages ?

sample data:

<!--Then paste the following for Kendo UI Web scripts-->
<script src="kendo/js/jquery.min.js" type="text/javascript"></script>
<script src="kendo/js/kendo.web.min.js" type="text/javascript"></script>
<table id="grid">
<thead>
<th data-field="name">Name</th>
<th data-field="reference">Reference</th>
<th data-field="type">Type</th>
</thead>
<tbody><<tr ><td class="">Course 1</td><td class="">BN1BANI/2FD</td><td class="">Course</td></tr><tr ><td class="">Sport  2yr FT Day</td><td class="">KN1ICTW/2FD</td><td class="">Course</td></tr><tr ><td class="">Chemistry Non-cert </td><td class="">KNCBRCH/1FD</td><td class="">Course</td></tr><tr ><td class="">Physics Non-cert 1yr FT Day</td><td class="">KNCBRPH/1FD</td><td class="">Course</td></tr></tbody>
</table><script>
$(document).ready(function(){
      $("#grid").kendoGrid({
         groupable: true,
         scrollable: true,
         sortable: true,
         pageable: true
      });
  });
            </script>

forgive me this once for the rambling post - I'm probably a million miles away from what the problem really is and have not learned all of the terminology yet
Les
Top achievements
Rank 1
 asked on 26 Apr 2012
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
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
+? 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?