Telerik Forums
Kendo UI for jQuery Forum
2 answers
170 views
Hi,

I have an MVC 4 application and I am trying to populate a kendo grid control.

I am calling a method from a jquery click event 
$('#btnSearch').click(function () {
        $.ajax({
            type: "GET",
            url: "/PropertyAddress/SearchForPostcode",
            data: { postcode: $('#Postcode').val(), property: $('#Property').val() },
            success: function (result) {
                $("#dialog-addresssearch").data('addresses',result).dialog('open');
            }
        });
    });

my controller is passing back a JSON formatted result set.
//controller detail removed 
return this.Json(postcodeAddresses, JsonRequestBehavior.AllowGet);

this is being passed to a jquery ui dialog box in the open call to the dialog box.

I have the following html mark up on the dialog box 
 <div id="grid"></div>

in the open method of the dialog box I set up the datasource and the grid in jquery
this is the passed in JSON results, I have checked and validated that this is correct JSON

 var results = $(this).data('addresses');
create new data source
            var gridDataSource = new kendo.data.DataSource({
                type: "json",
                data: results,
                pageSize: 1
            });           

   gridDataSource.read();

            $('#grid').kendoGrid({
                datasource: gridDataSource,
                columns: [
                     { field: "Premise", title: "Name or number" },
                     { field: "Organisation", title: "Organisation" },
                     { field: "Street", title: "Street" },
                     { field: "Locality", title: "Locality" },
                     { field: "PostTown", title: "Town or city" },
                     { field: "Postcode", title: "Postcode" }
                ],
                scrollable: false,
                pageable: true
            });
  

This all works with no errors, it shows a grid on the dialog box, it shows paging except there are no results shown, I have checked and validated the JSON and verified that there is data in the results. 

I am clearly missing something but really not sure what it is I have tried a number of examples, for instance if I add a JSON array to the datasource instead of passing in the results this seems to populate OK. I can only assume it must be something to do with the data but unable to track down the issue.

Hoping that someone can spot my mistake





Duncan
Top achievements
Rank 1
 answered on 04 Sep 2012
0 answers
135 views
Hi all

I have created 3 dropdownlist in my page and I have 3 functions that get the data from a webservice and store it in a datasource. The second function is called on the change event of the first function, and the third function is called on the change event of the second function. My code worked well on browser, but when I ported to android through phonegap, when I go to any page that has dropdown list as soon as the page is loaded, it brings up an empty selection (as if someone selected a dropdown list that is empty), but the data is actually being placed in all 3 drop down lists. So when I touch away from that selection, everything works fine. But how can I prevent it from displaying that empty selection ? 
Pourya
Top achievements
Rank 1
 asked on 04 Sep 2012
1 answer
213 views
hi all,



I've a listview bound to MVC4 ApiController calls, this all works fine except when I try to insert a duplicate.

My server will fail it's validation and return a different HttpStatus code,



how can I cancel the insert?? or even refresh the listview?



also,, kendo appears to call my ApiController multiple times from now on when creating new valid records, it's like it keeps trying to resend the invalid entry :-(







Nikolay Rusev
Telerik team
 answered on 04 Sep 2012
3 answers
981 views
This seems like it would happen automatically but I'm not seeing it.

I send a viewmodel with my attributes to my controller. It makes the necessary update and returns a value or the model.

If I send back the model, will the datasource make the correct updates to the attributes that are now updated?

[EDIT]
After extensive debugging and a lot of searching on the forum for jewels of information I came across one that gave me an idea.

In order to make a change to your ViewModel: Model you have to go to your DataSource.change method. In here, you then create a function to get the data from the JSON result passed back from your controller. In my case, I am submitting my whole model and returning it with an updated value called YTM.

Here is a snippet of code that will help you:
change: function() { // subscribe to the CHANGE event of the data source
                           viewModel.data = this.view()[0];
                           viewModel.order.set("ResidualYield", viewModel.data.ResidualYield);
                           
                       }

The ViewModel data attributes are stored in data. You can inspect this using the inspector in Chrome. What happens is that this will get the viewmodel. In my example, my viewmodel has a model called "order". I get a handle to this and then set it from the return JSON in viewModel.data. If someone has a better "best practice" let me know. This took me several days to figure out because of the lack of good documentation. 
Alexander Valchev
Telerik team
 answered on 04 Sep 2012
1 answer
119 views
Hi,

Can I know whether KendoUI provides this KnockoutJS to kendoUI integration for Grid as well?

I am referring to this example http://demos.kendoui.com/web/integration/index.html 

Can this integration be done for Kendo Grid as well? Is this only for the components given in this example? In this example it does not provide a grid integration.

Thanks in advance.
Vladimir Iliev
Telerik team
 answered on 03 Sep 2012
2 answers
302 views
Hi

Please fix the number formatting for culture en-ZA as it is incorrect and not consistant with af-ZA. The af-ZA culture file has the correct formating.

kendo.culture.en-ZA.js Kendo UI Web v2012.2.710 uses i.e. a comma for the decimal point and a space for the thousands separator.
The error is for decimals, percentage and currency.

kendo.culture.af-ZA.js Kendo UI Web v2012.2.710 has the correct formating.


Thanks
Gareth


Gareth
Top achievements
Rank 1
 answered on 03 Sep 2012
2 answers
1.1K+ views
Hi,


Please suggest me a way to load the nodes of a tree view dynamically and also add nodes to the tree view and to save those nodes in the data base tables.........

Thanks in Advance,
Ruqsana.
Nohinn
Top achievements
Rank 1
 answered on 03 Sep 2012
3 answers
286 views
hi,
i'm using a dataSource for my kendoTapStrip, the dataTextField needs to be encoded for each tab.
is it possible to apply a global setting in the config to encode all tab text fields?

cheers,
dave
Petur Subev
Telerik team
 answered on 03 Sep 2012
5 answers
316 views
I am trying to get the chart to work in a way I need.

Lets say I have the following chat

@(Html.Kendo().Chart()
                  .Name("chart")
                  .Title("Number 1")
                  .Legend(legend => legend
                                        .Position(ChartLegendPosition.Bottom)
                  )
                  .Series(series => {
                                        //  series.Column(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
                                        series.Column(new double[] { 67.96, 68.93, 75, 74, 78,77,12,19,99,79 }).Name("Rating");
                  })
                  .CategoryAxis(axis => axis
                                            .Categories("1", "2", "3", "4", "5","6","7","8","9","10")
                  )
                  .ValueAxis(axis => axis
                                         .Numeric().Labels(labels => labels.Format("{0}"))
                  )
                  .Tooltip(tooltip => tooltip
                                          .Visible(true)
                                          .Format("{0}")
                  ).Events(events => events
        .SeriesClick("onSeriesClick")
    )
                  )


As you can see I have the series click event hooked up. If I click on the series I can see
Object
category: "6"
dataItem: 77
element: jQuery.fn.jQuery.init[1]
isDefaultPrevented: function (){return g}
preventDefault: function (){g=!0}
sender: n.extend.init
series: Object
value: 77
__proto__: Object
I have clicked on the 6th column within the graph to get the above result.

Can I get access to the graph's name that has been clicked on? I am building a page that could have many graphs on it so I am wanting to build a reusable function.
Ideally somehow I would like to get the name of the graph that's been clicked on.


Thank you
Hristo Germanov
Telerik team
 answered on 03 Sep 2012
1 answer
335 views
I have a menu at the top of my web application that is working and looks good.  However, I would like all of the items in the menu to align to the right side of the page.  Is there a way to do this using the MVC wrappers?  Or, do I need to enclose the menu in a <div> that is floated right, or some other CSS trick.

Thanks
Dimo
Telerik team
 answered on 03 Sep 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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?