Telerik Forums
Kendo UI for jQuery Forum
2 answers
676 views

I have a dropdownlist in a grid. When I put a row in edit mode and change the selected value of the ddl, the data sent to my update procedure is the value field (i.e. 1, 5, 7). What I want to send is the text field (i.e. Apples, Oranages, Bananas).

How can I ensure the text value of the dropdownlist is being sent to my update method?

If I don't change the selection it works like I want (meaning the text value is sent to my update procedure). Only when I change the selected value the parameter value sent is the value field.


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="grid">
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#grid").kendoGrid({
                //height: 260,
                toolbar: ["create"],
                columns: [
                    "DepartmentID",
                    { field: "FRSAccountNumber", title: "FRS Account No", sortable: true, filterable: true },
                    { field: "DepartmentName", title: "Dept Name", sortable: true, filterable: true },
                    { field: "CollegeName", width: "150px", editor: categoryDropDownEditor },
                    { field: "SubjectArea", title: "Subj Area", sortable: true, filterable: true },
                    { command: ["edit", "destroy"], title: " ", width: "210px", filterable: false }
                        ],
                editable: "inline",
                dataSource: {
                    //batch: true,
                    pageSize: 10,
                    schema: {
                        data: function (data) {
                            return data.d || [];
                        },
                        type: "json",
                        total: "d.length",
                        model: {
                            id: "DepartmentID",
                            fields: {
                                DepartmentID: { type: "number" },
                                FRSAccountNumber: { type: "string" },
                                DepartmentName: { type: "string" },
                                CollegeName: "CollegeName",
                                SubjectArea: { type: "string" }
                            }//fields
                        }//model
                    }, //schema
                    transport: {
                        read: {
                            url: "Web/KendoDS.asmx/ReadDepartments",
                            contentType: "application/json; charset=utf-8",
                            type: "POST"
                        }, //read
                        update: {
                            url: "Web/KendoDS.asmx/Update",
                            contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                            type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
                        },
                        parameterMap: function (data, operation) {
                            if (operation != "read") {
                                return JSON.stringify({ dept: data });
                            }
                        }
                    }//transport
                }, //dataSource
                pageable: true
            });
 
            var categoryDataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "Web/KendoDS.asmx/GetColleges",
                        contentType: "application/json; charset=utf-8",
                        type: "POST"
                    }
                },
                schema: {
                    data: "d"
                }
            });
            
            function categoryDropDownEditor(container, options) {
                $('<input data-text-field="CollegeName" data-value-field="Ranking" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                    autoBind: false,
                    dataSource: categoryDataSource
                });
            }
        });
 
 
 
 
 
 
 
 
    </script>
</asp:Content>
Joe
Top achievements
Rank 2
 answered on 01 Oct 2012
1 answer
148 views
Hi,

is this statement 

<select data-role="dropdownlist" data-bind="source: type, value: expenseType">
    <span data-text-field="name" data-value-field="value" >
</select>

in the example http://docs.kendoui.com/tutorials/mvvm-in-kendo-ui correct? Because it doesn't work. In JSFiddle example you use this

<select data-role="dropdownlist" data-bind="source: type, value: expenseType" data-text-field="name" data-value-field="value" ></select>

statement.
Alexander Valchev
Telerik team
 answered on 01 Oct 2012
6 answers
425 views
Hi

I have a Grid with a custom editor. The custom editor has the possibility to open a dialog where the user can search for the value. If I open the dialog the grid close the editing mode

See a simplified solution which reproduce the problem on jsfiddle
When you click on the search button, the dialog opens and the grid cancel the editing mode

Thanks for your help
Roland
Top achievements
Rank 1
 answered on 01 Oct 2012
0 answers
197 views
Hi,

I am trying to filter the datasource based on the selection on the grid and populate the treeview.
I am able to filter the data source using the filter property. As this returns Observable objects, I am not able to bind the treeview. In fact, if I mention the datasource of the treeview to this result (which is observable object) nothing happens.

I even tried using query (as shown below) but still no success to bind the treeview
var dsFilter = [{ field: "id", operator: "eq", value: selectedItem.BaseObjId}];

var query = new kendo.data.Query(dataSource);
var data = query.filter(dsFilter).data;

Let me know if I am missing anything or any better approach to do the same?

Thanks…

Regards,
Monish.

Monish
Top achievements
Rank 1
 asked on 01 Oct 2012
2 answers
151 views
Hello

When the combobox opens downwards and when I filter everything works as expected. However, if it open upwards and I start to filter, the result box becomes detached from the input, and it looks pretty messy at least. Please check attached screenshot. What's the workaround ?

Thanks.
Georgi Krustev
Telerik team
 answered on 01 Oct 2012
2 answers
204 views
Hi,
is it possible to create Charts, where i can resize the bars and geht back the new Value?

Like you can see here: http://www.rgraph.net/docs/adjusting_gantt.html

that would be awesome


Thanks
Best Regards
Rene
Harshita
Top achievements
Rank 1
 answered on 01 Oct 2012
0 answers
219 views

I am new to kendoUI and facing a few issues
1. not able to get the grid reference. (for changing the grid properties)
var grd = $("#grid").data("kendoGrid"); // Not working. grd is shown as undefined.

2. DataBound event is not recognized.

Please let me know what i am I missing here.

Please find my code below
<div class="k-content">
@(Html.Kendo().Grid(Model)
      .Name("grid")
      .Columns(columns =>
                   {
                       columns.Bound(company => company.Id).Hidden();
                       columns.Bound(company => company.CompanyName).Sortable(true).Width(120);
                       columns.Bound(company => company.Email).Sortable(true).Width(150);
                       columns.Bound(company => company.CompanyAddressAddress1).Width(120);
                       columns.Bound(company => company.CompanyAddressAddress2).Width(120);
                       columns.Bound(company => company.CompanyAddressCity);
                       columns.Bound(company => company.CompanyAddressStateAbbreviation).Width(80);
                       columns.Bound(company => company.CompanyAddressZip).Width(100);
                       columns.Command(command =>
                                           {
                                               command.Edit();
                                               command.Destroy();
                                           }).Width(180);
                   })
      .ToolBar(toolbar => toolbar.Create())

      .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("CompanyCreate")
                           .Window(window => window.Title("Company Profile").Name("CompanyEdit"))
      )
      .Groupable()
      .Pageable()
      .Sortable()
      .Scrollable()
      .Filterable()
      .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .ServerOperation(false)
                                    .Events(
                                    events =>
                                    {
                                        //events.Change("");
                                        events.Error("error_handler");                                      
                                        events.DataBound("reload_grid");//gives error
                                    }

    )
        .Model(model => model.Id(company => company.Id))
        .Create(update => update.Action("CompanyCreate", "Company", new { act = "Create" }))
        .Update(update => update.Action("CompanyUpdate", "Company", new { act = "Update" }))
        .Destroy(update => update.Action("CompanyDestroy", "Company"))
    .Read(read => read.Action("CompanyRead", "Company"))
    )
      )
<script type="text/javascript">
    // get a reference to the grid
var grd = $("#grid").data("kendoGrid"); // Not working. grd is shown as undefined.
   
       
    $(".k-grid-add").on("click", function (e) {
    
       var insertMode = e.model.isNew(); //gives error
       
        var window = e.container.data("kendoWindow");//gives error
        e.container.kendoWindow("title", "Add new record");//gives error.      
       
    });

 function reload_grid(e) {
        //alert("reload");
    }
</script>.

Praseeda
Top achievements
Rank 1
 asked on 01 Oct 2012
3 answers
96 views
the native mobile widgets such as datetime, date and time are limiting.  i'd like to use the kendoUI datepicker.  Is that supported?
Kamen Bundev
Telerik team
 answered on 01 Oct 2012
1 answer
368 views
Hi,

We're using kendo menu and facing below two issues:

1. The top level main menu shows up properly however on hover of these main menus, the sub menu that shows up has huge width. Can you please let me know what all css classes to override to set the width of sub menu's properly.

On hover of sub menu's, the hover happens only on the text but the sub menu's width is bloated.

2. If we give width of main menu as 100% and set its left css property, it is aligned to left properly however it is not taking 100% width. I'd given 100% width to the parent container (a div element) containing the menu.

Can you please let us know on this, what all css classes to override or anything else we might be missing?
Dimo
Telerik team
 answered on 01 Oct 2012
4 answers
1.8K+ views
Hi :) , 

i'm trying to display my string with json but i'm seeing the tag <br/> instead of the line break:

what i expected:
" this is a 
line break"

what i see:
"this is a<br/>line break"

on my document I've write 
<div>${content}</div>

Someone can help me, please? :) :)
Marco
Top achievements
Rank 1
 answered on 01 Oct 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
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?