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

I making a simple autocomplete with remote json data, but it's not working, any idea?
thanks.

                var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        dataType: "json",
                        url: "http://www.crystalgroup.info/index.php/ajax/customer"
                    }
                  }
                   
            });
 
            $("#input_customer").kendoAutoComplete({
                dataTextField: "title",
                filter: "contains",
                minLength: 2,
                dataSource:dataSource
            });
CH
Top achievements
Rank 1
 answered on 15 Jul 2013
2 answers
1.6K+ views
I am using a kendoDropDownList in cell edit mode. User can select the value of the drop down list through keyboard. When they press Enter, the new value is saved back to the dataSource.

From here, two things I am trying to do. One is additional keyboard support for using left and right arrow to submit the new value too. Another one is pressing a key to cycle through all options begin with that key.
Eg. if it's a list about cities in U.S., pressing C will select Cleveland, pressing C again will select Colorado Springs etc.

What I done is hook up a downDown event to the kendoDropDownList during the grid edit event handler.
edit: function (e) {
                    var input = e.container.find('input');
                    var currentValue = input.val();
                    if (e.container.find('.k-dropdown').length > 0) {
                        input = e.container.find('.k-dropdown');
                        currentValue = e.container.find('.k-input').text();
                    }
 
                    input.off('keydown', handleKeyDown);
                    input.on('keydown', null, { input: input, value: currentValue, isDropDownList: (e.container.find('.k-dropdown').length > 0) }, handleKeyDown);
                },
In the event handler, I figured out the next value to select, then I ran a problem. I don't know how to get this value saved back to the dataSource. I tried a couple of ways like.
$(el).find('input').data('kendoDropDownList').select(selectedIndex + 1);
$(el).find('input').data('kendoDropDownList').value(newValue);
$(el[0]).find(".k-input").text(newValue);
In the debugging, I can see kendroDropDownList.value() does give me the newValue. But that is just changed at the drop down list, the underlying dataSource is not changed. so when I do grid.closeCell(), or grid.SaveRow(), the old value is populated back to the drop down list.

There must be a step in between that will make the grid commit changes to its dataSource, please help.

Thank you
ITS
Top achievements
Rank 1
 answered on 14 Jul 2013
1 answer
162 views
By default the Kendo Grid for ASP.NET MVC will perform server side requests and load the page and grid on a single request. However, when configured for ajax binding the Kendo Grid for ASP.NET MVC will make ajax requests after the page is loaded which requires one extra request (one for the page and one extra for the data used by the grid). Is there a way to combine Server Binding and Ajax Binding to eliminate the extra request made in Ajax binding? All I'm looking for is to load the data for the page and grid at the same request (like Server Side Binding) for the first time and use Ajax Binding for subsequent requests. To disable the initial load on Ajax Binding we can disable the AutoBind Configuration Option (autoBind:false) of the grid. Now, I need a way to show the data on the grid. 

Josh
Top achievements
Rank 1
 answered on 13 Jul 2013
4 answers
143 views
We recently purchased the Kendo MVC wrappers.  Now an MVC4 app that uses the Kendo menus and worked with the trial license, doesn't display any of the menus that have sub-menus until you either resize the window or mouse over the menu.  Menu items that have no children display when the page initially renders.  We see this only in IE 10.  Firefox, Chrome, & Safari all show-up as expected.
Tom
Top achievements
Rank 1
 answered on 12 Jul 2013
0 answers
94 views
I just worked through adding a MultiSelect fillter on a page with a grid, and didn't see anything in the forums that addressed this issue, so I thought I would post the result that I came up with.
<%= Html.Kendo().MultiSelectFor(m => m.FilterRoleIds)
        .Placeholder("Select Roles")
        .DataTextField("RoleName")
        .DataValueField("ApRoleId")
        .BindTo(ViewBag.ApRolesList)
%>
  
<%= Html.Kendo().MultiSelectFor(m => m.FilterCompanyIds)
        .Placeholder("Select Companies")
        .DataTextField("CompanyName")
        .DataValueField("CompanyId")
        .BindTo(ViewBag.CompanyList)
%>
  
<script language="javascript" type="text/javascript">
    function additionalData() {
        return {
            roleIds: "<%= ApRoleController.ReturnListValues(Model.FilterRoleIds) %>",
            companyIds: "<%= ApRoleController.ReturnListValues(Model.FilterCompanyIds) %>"
        };
    }
</script>
 
        public static string ReturnListValues(List<string> list)
        {
            if (list == null || list.Count == 0) return "";
 
            string s = string.Empty;
 
            foreach (var item in list)
            {
                if (s != string.Empty)
                    s += ",";
 
                s += item;
            }
 
            return s;
        }
Above is what I came up with.
Telerik came up with the following:
<script language="javascript" type="text/javascript">
    function additionalData() {
        var roleIds = <%= Html.Raw(Json.Encode(Model.FilterRoleIds)) %>;
        var data = {};
        for(var i=0; i< roleIds.length;i++){
            data["FilterRoleIds[" + i + "]"] = roleIds[i];
        }
        return data;
    }
</script>
Hopefully, this will be helpful to somebody.
Atlas
Top achievements
Rank 1
 asked on 12 Jul 2013
2 answers
160 views
Hi, I have a dropdownlist that I refresh with other code. It loads a list of items to process, once an item is processed the item is basically marked as done and when the dropdownlist is refreshed it no longer is in the dropdownlist. This works just fine till I get to the last item, when it is processed and the dropdownlist is refreshed the json basically returns a empty List<ViewModels.DayEndCycleNumbersViewModel>, 0 items, what happens it the dropdownlist isn't cleared to nothing. If I refresh the page the dropdownlist is empty. How can I get the dropdownlist to be empty when it is refreshed?

Thanks,
John
John
Top achievements
Rank 1
 answered on 12 Jul 2013
1 answer
88 views
I'm using Pie Charts in a mobile ScrollView. On PC, while hovering the charts with mouse cursor, each pie is highlighted by creating an overlay. This overlay prevents me from swiping through views. How can  I disable it?

seriesHover: function(e){
   e.preventDefault()
}
The above is not working, even though it gets triggered every time. Of course, on mobile there is no mouseover, but when you tap and swipe, the overlay gets toggled, so swiping works only half of the time .

Alexandru
Top achievements
Rank 1
 answered on 12 Jul 2013
2 answers
459 views
I have a master-detail grid and I want to use a Kendo NumericTextBox as ClientTemplate for one of the columns in the detail grid:

columns.Bound(x => x.MaximumWindowWeeks).ClientTemplate(this.Html.Kendo().NumericTextBox<int>().Name("Test").ToClientTemplate().ToHtmlString());

When expanding the details for a given row, I get the error below and none of the rows are rendered:

SyntaxError: unterminated string literal
...itle":"Maximum Window Weeks","template":"<input id=\"Test\" name=\"Test\" type=\...

Do I need to somehow "escape" the column client template, since I'm defining it as part of another client template?

Thanks!
Marius
Top achievements
Rank 1
 answered on 12 Jul 2013
3 answers
83 views
I can't seem to find a way to find my old answered posts in this forum. Is there a way?
Alex
Telerik team
 answered on 12 Jul 2013
3 answers
244 views
I'm looking to use Kendo to enhance an existing PHP web app at the company I work for. Currently all of the data in the app is extracted from a MySQL database, processed and setup as an array, then output as an HTML table.

I'd like to use Kendo as a 'drop-in' replacement for the tables, which means all the data will come from PHP arrays. I've read the docco and got started using the PHP Wrapper, and the following code:
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data($my_array)

Most things are working great, and I'm very impressed. However there's one problem - dates aren't sortable. This is a pretty killer issue for the web app, given that it has a lot of inventory and sales information.

I think the problem is the format of the dates - currently they are 'raw' dates in d/MM/yyy format (no leading  0 on days). But I have also experimented with injecting them them as dd/MM/yyyy, yyyy-mm-dd, and unix time stamps (second since the epoch, otherwise know as date('u') in PHP). But no matter what I do, the dates always sort as if they are just numbers.

Does anyone know what date format is acceptable to Kendo UI's PHP Wrapper, when coming from a PHP array?

I've succesfully used format({0:c}) to represent currency information, and I've read that format({0:d}) can accomplish something with dates, but I've had no luck. I've also tried format({0:d/MM/yyyy}) and a handful of others, but it doesn't change the data.

Does the ->format() function have any relationship to sorting? Or does it just change the visual output of the columns? 

I'm aware that I can hook Kendo up to the data sources directly (and that this is a preferred option), but as I said I'm attempting to use this as a 'drop-in' replacement for tables right now. It's not worth the effort of rewriting so much of the app at this stage, I'm just evaluating. Further, both Easy UI and dHTMLxGrid are capable of taking a PHP array that includes a date and treating it correctly, so I'd be very surprised if Kendo couldn't.

I would have thought this was a pretty common use case, but I can't find anything specific to this example in the docs, tutorials, API etc. Can anyone assist?

Regards,
Sam Miller
Alexander Valchev
Telerik team
 answered on 12 Jul 2013
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?