Telerik Forums
Kendo UI for jQuery Forum
1 answer
183 views
Hi everyone,

I am working on creating cascading combo boxes. I would like to use a data that is being pre-loaded as C# objects, which then will be convert into JSON model and use as a datasource.

I looked at the example code from the cascading combo box demo and realized that it uses Odata points to some web service, which return a large xml-liked file content, which gives me a bit of difficult time understanding how the 1st combo box can be used to determine what get to be displayed on the 2nd combo box.

So if we take cascading combo boxes for country and state as an example. If I were to have the first combo box as a country like this.

        $(".country-combo-box").kendoComboBox({
            dataTextField: "text",
            dataValueField: "value",
            dataSource: [
                { text: "United States of America", value: "US" },
                { text: "Canada", value: "CA" },
                { text: "United Kingdom", value: "UK" },
                { text: "France", value: "FR" }
            ],
            filter: "contains",
            suggest: true,
            index: 0
        });

How would I set up the 2nd combo box, so that if I select the US as a country  and expect the 2nd combo to display on the states that belong to the US although technically the datasource for the 2nd combo box should contains all states for every country?

Would the datasource for the 2nd combo box looks like this? 
 dataSource: [
                { country: "US", text: "New York", value: "NY" },
                { country: "US", text: "Texas", value: "TX" }, 
                { country: "US", text: "Florida", value: "FL" }, 
                { country: "CA", text: "Alberta", value: "AL" }, 
            ], 
If so, how do I set the filter on the 2nd combo box to only select all states for a specific country?

I appreciate your time helping me on this. 

Thank you very much,

Patt






 
Patt
Top achievements
Rank 1
 answered on 01 Aug 2012
1 answer
151 views
I believe I may have found a bug in the class assignment of spans when using a Grid with inline editing. When adding a new record with a field that is designated as a number, I get a textbox with arrow on the right to adjust the value up or down. Both arrows that are appearing are up arrows. I looked at the rendered code and saw the following:

<span class="k-select">
  <span unselectable="on" class="k-link">
    <span unselectable="on" class="k-icon k-i-arrow-n" title="Increase value">Increase value</span>
  </span>
  <span unselectable="on" class="k-link">
    <span unselectable="on" class="k-icon k-i-arrow-s" title="Decrease value">Decrease value</span>
  </span>
</span>

notice the "k-i-arrow-n" and "k-i-arrow-s" classes. These are not located in the CSS file. I changed the classes to "k-arrow-up" and "k-arrow-down" and the arrows rendered properly.

I've added local style definitions on my page to correct this, but thought I would let you know to update the code. Thanks.
Philip Senechal
Top achievements
Rank 1
 answered on 01 Aug 2012
0 answers
110 views
Is there a way to have a column in a grid lets say the first column to move along with the scroll bar and always be the first column like in excel. Any help regarding this is much appreciated.
Kavitha
Top achievements
Rank 1
 asked on 01 Aug 2012
0 answers
314 views
Problem: Grid contents after refresh
Context: Grid backed by a JSON remote service -- Python Django + Tastypie

Steps to Reproduce:
1. Setup your data feed such that based on the pageSize that the last page only contains one item. 
2. Initialize your kendo grid 
3. Delete the item on the last page. 
4. Refresh the Kendo Grid
[code]

function refreshKendoGrid(gridId) {

var grid = $(gridId).data("kendoGrid");

//reload grid's datasource

grid.dataSource.read(); 

// refreshes the grid

grid.refresh();

}
[code]

5. Grid shows no entries within the k-grid though the page number is set to correct page (page 1, prior to item deletion there were 2 pages)

 
Steve
Top achievements
Rank 1
 asked on 01 Aug 2012
0 answers
103 views
I'm using the function Json to serialize a Linq query, and on the client side I'm got this result for dates:  "/Date(1343800800000)/" 

How can I tell the grid this is a date?, and more important, how can I fllter it?

I know I can use templates to display the date, but I can't use filters
Alejandro
Top achievements
Rank 1
 asked on 01 Aug 2012
5 answers
581 views
I tried your demo on this web where it show how date picker can do globalization. When I changed culture to Thai, the year incorrectly showed Buddhist year (2555). Is there a way to fix this?
Georgi Krustev
Telerik team
 answered on 01 Aug 2012
1 answer
144 views
If we have a table, and the rows (tr) are each are bound to a function off of "visible"...how do you handle that in the function itself

The TR looks like this

<tr data-mf="3" data-bind="visible: isSelectedMF">

...so in that function is there any way to get that "3" from the data-mf element?
Atanas Korchev
Telerik team
 answered on 01 Aug 2012
1 answer
537 views
Hi All,

I have a datasource that is defined and under a specific circumstance i need to run a function after a read() is completed.

Is something like this possible:

dsCommodities.read(function () {
                //do stuff
            });


I have the ds defined normally but need to dynamically execute a function for one particular read scenario. thanks!
Rich
Top achievements
Rank 1
 answered on 01 Aug 2012
6 answers
419 views
Please help me. I encountered a very strange behavior of the kendoDateTimePicker widget.

When i'm using kendoDateTimePicker widget as editor in kendoGrid, and click on clock icon, this widget show me string "01.01.1900" before time part in drop-down list (see attached picture).

For example:
   ...
"01.01.1900 4:30"  instead of  "4:30"
"01.01.1900 5:00"                    "5:00"

  ...

My source code is:

<div id="grid"></div>
 
<script type="text/javascript">
    $(document).ready(function () {
 
        kendo.culture("ru-RU");
 
        var dataSource = new kendo.data.DataSource({
            transport: {
                read: { url: "http://localhost:6356/admin/GetUnitTogglesList" },
                update: { url: "http://localhost:6356/admin/UpdateUnitToggles" },
                destroy: { url: "http://localhost:6356/admin/DeleteUnitToggles" },
                create: { url: "http://localhost:6356/admin/CreateUnitToggle" }
            },
            batch: true,
            schema: {
                model: {
                    fields: {
                        Date: { type: "date" },
                        UnitId: { type: "number" },
                        Connect: { type: "boolean" }
                    }
                }
            }
        });
 
        dataSource.read();
 
        $("#grid").kendoGrid({
            dataSource: dataSource,
            navigatable: true,
            pageable: false,
            sortable: true,
            toolbar: ["create", "save", "cancel"],
            columns: [
              { field: "Date", title: "Date", template: '#= kendo.toString(Date, "dd.MM.yyyy H:mm") #', editor: timeEditor },
              { field: "UnitId", title: "Unit" },
              { field: "Connect", title: "Status" }
            ],
            editable: true
        });
    });
 
    function timeEditor(container, options) {
        $('<input name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDateTimePicker({
              format: "dd.MM.yyyy H:mm",
              timeFormat: "H:mm"             
            });
    }
</script>
Eugeny
Top achievements
Rank 1
 answered on 01 Aug 2012
0 answers
159 views
hi all,

i was trying to retrieve boolean value from database and display in a list view..
for that i want to design a checkbox,for that checkbox i have to keep a
star image,when i click on star it has to update the value in database and
retrieve list in listview..please have a look at this screen shot for better idea..
please help me out..
Pujita
Top achievements
Rank 1
 asked on 01 Aug 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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?