Telerik Forums
Kendo UI for jQuery Forum
12 answers
2.7K+ views
Hi

I have a grid that has a column that uses a DropDownList (see code below).  

columns: [
    { field: "Choices", title: "My Choices", width: "150px",
        editor: function(container, options) {
              $('<input data-text-field="Name" data-value-field="Value" data-bind="value:' + options.field + '"/>').appendTo(container).kendoDropDownList({
               dataSource: {
                     data: myChoicesArray
              },
              dataValueField: "Value",
              dataTextField: "Name",
              autobind: true
          });
      }
   },
   { command: ["edit", "destroy"], title: " ", width: "210px" }
],

I'm using kendoui.complete.2012.1.229.beta

I have 2 issues:

1. When the user clicks on 'Add new record' and edits ALL the fields, the binding is fine.  If the user wants to use the default value in the DropDownList (i.e. no onChange event), on clicking 'Update', the value from the DropDownList is not bound and the value in the column remains blank.  This happens if I set the editing mode to 'inline' or 'popup'.  How do I get it to bind the default value?

2. I'm using a MVVM viewModel to store the details in the grid which will be sent to the server in a subsequent step.  If I set data-value-field="Value", I get the value (incorrectly) appearing in the grid and the viewModel correctly gets the value.  On the otherhand, if I set data-value-field="Name", I get the text correctly appearing in the grid but then the viewModel incorrectly gets the text too.  I would like to have the text of the DropDownList choice appear in grid and the value of the choice stored in the viewModel.  How can I do this?

Thanks
Rosen
Telerik team
 answered on 28 Sep 2012
7 answers
524 views
Hi
 I want to display specific month (not current month) on load of kendo calendar, Any Suggestion
Kula
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
180 views
I am binding tree view to a model. I want to add 'static' parent node. Is it possible? Here is code I am using now. 

<%
= Html.Telerik().TreeView()
           
.Name("TreeView")
           
.BindTo(Model, mappings =>
           
{
                mappings
.For<Employees>(binding => binding
                       
.ItemDataBound((item, emp) =>
                       
{
                            item
.Text = emp.EmpName;
                       
}));                    
           
})            
%>
Devon
Top achievements
Rank 1
 answered on 27 Sep 2012
0 answers
60 views
hi there, i want to change the <td> width inside the grid view.
some <td> i want it with 310 px, for instance , the first td. the second td i want it with 290 px
I try to do it over <td width = "310px"> or external css , none of them works.

maybe i just not using the right syntax.

plz help.

my code 

<div id="example" class="k-content">
 
 
<table id="grid" style="float: left; position: relative">
    <thead>
        <tr>
            <th width ="310px"data-field="FileName">File Name
            </th>
            <th  width ="290px"data-field="ID">File Identifier
            </th>
 
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr >
                <td  class="idRank" >
                    @item.FileName
                </td>
                <td  class="idRank2"  >
                    @item.ID
                </td>
 
            </tr>
        }
    </tbody>

it works for <th>, i want the <td> match with <th>
Edward
Top achievements
Rank 1
 asked on 27 Sep 2012
0 answers
162 views
Hello,

I have a grid that's being bound to a datatable and works fine with server requests. But once I try binding via ajax I get a circular reference error. I tried to use a helper method to convert the datatable into List<Dictionary<string, object>> and bind the grid to said collection, but I can't get that to work either.
My need to use a DataTable stems from a particular use case, let me illustrate:
The application enlists certain areas within a manufacturing process, each area has a list of part numbers/names; in a different form defects are being captured for particular parts. The grid must be rendered "dynamically" based on the part names listed for a particular area in the database, and the amount of defects for each part, like so:

Column 0 Column 1 Column 2 Column 3 Column 4
Defect Silicone seal FF Mask Headgear Swivel
Bubbles in functional area 0 0 0 3
Heterogeneous coloring 4 0 1 0
... ... ... ... ...

Column0 is fixed and must happen for all instances of the grid, the number of columns after this one depends on what I mentioned above, so the overall number of columns and member name/title will vary.
My first approach was to build a DataTable from the information retrieved from database, which works fine with server binding, but I'm stumped as to how to use ajax binding (which is needed for requirements not listed here). I've attached a sample project with my approach. Any suggestions?
Josias
Top achievements
Rank 1
 asked on 27 Sep 2012
0 answers
161 views
Hi there,

I've got kendo (The web widgets) working across multiple pages and haven't really had any major issues getting it all to work the way I'd like across all browsers. Everything's displaying the way it's supposed to be and functioning great - that said there's one little thing I'd like to improve.

When I load any of my pages in firefox there's a split second delay in which I see my menu as an unordered list and unstyled (see before.png attached). It snaps into place with the proper styling(after.png) pretty quickly, but it's still an undesirable transition as everything on the page then shifts to position itself again.

This doesn't happen in Chrome or ie, on load the menu is styled before any elements are shown. Is this a firefox flaw, a jquery/javascript problem a kendo menu+firefox problem or just some kind of fault on my part?

Any suggestions are welcome,
Thank you
Hunter
Top achievements
Rank 1
 asked on 27 Sep 2012
1 answer
124 views
Hi! 
I have found very strange issue, which happens only on iPad Safari, on iPad Chrome not.
The Mobile Split view application has on the left pane mobile listview which switches views on the right pane, as in your example, but after each switching Ajax request is made (asynchronous) to retrieve data for selected view.

View elements are bound to view model with MVVM, for example
<div data-bind="text:value"></div> or <input data-bind="value:value"/> etc. and Ajax update with "set" method my view model.

Everything works good on Windows Chrome and Safari, except on iPad in Safari: sometimes MVVM DOM elements are not updated to the correct value. I'm sure the value was "set" in view model, but divs and inputs was not updated. Things I discovered in last two days:

1. If I change focus to input, that was not correctly updated, it becomes immediately correct value
2. if I change view to another and back,even without ajax, all divs and inputs are now updated
3. (this one very strange but true) divs and inputs, which bound value or text was previously empty string becomes updated!! divs and input fields, which previous value was something but not empty -becomes NOT updated!! 

So for now I use very dirty workaround set each value first to empty string, and then set it to value that came with Ajax response. 

Question: maybe you could somehow explain why? 
About workaround - is there any possibility to refresh view, see point 2: change view to another and back updates all fields, and I could maybe call something after Ajax response is processed?

Again, the problem only occurs on iPad Safari. I have yesterday updated to iOS6, no difference.

Thanks in advance.

Alex
Top achievements
Rank 1
 answered on 27 Sep 2012
3 answers
521 views
I have Autocomplete box with watermark text . I'm clearing the Autocomplete using value method and excepting Watermark to reappear after clear. None of these are working... i'm missing something ?

$('#city').data('kendoAutoComplete').value(null); or $('#city').data('kendoAutoComplete').value(undefined); or  $('#city').data('kendoAutoComplete').value('');
Daniel
Telerik team
 answered on 27 Sep 2012
1 answer
101 views
Hi,

I met a strange issue.

In DOM load, I create a kendo grid with remote data source:
$(document).ready(function () {
    LocationGridDataSource = new kendo.data.DataSource({ type: "json" ...);
    LocationGrid = ...
}

There is an ajax form in my page:
@using (Ajax.BeginForm("Bind", "Test", null, new AjaxOptions { OnSuccess = "BindOnSuccess" }, new { id = "BindForm" }))
{}

I use $("#BindForm").submit() to mannually submit the ajax form.
In BindOnSuccess, I use datasource.get:
function BindOnSuccess(context){
    ....
    var location = LocationGridDataSource.get(context.id);
    var selection = LocationGrid.table.find('tr[data-uid="' + location.uid + '"]');
    ....
}

Sometimes location which is got from LocationGridDataSource.get(context.id) is NULL, sometimes it will get object successfully.

After my debugging, my questions:
1. The problem is caused by LocationGridDataSource is not ready after ajax returns?
2. Is there a mechanism to ensure I can call LocationGridDataSource.get() based on a READY datasource object?

Any comments or instruction?

Thanks.
John
Top achievements
Rank 1
 answered on 27 Sep 2012
0 answers
79 views
How do i to change the item template from the Panelbar in order to add new attributes to the li element?
How can i access the datasource item for the select item?
ecobite
Top achievements
Rank 1
 asked on 27 Sep 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
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
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?