Telerik Forums
Kendo UI for jQuery Forum
4 answers
263 views

Given then below sample grid, that is loaded using a webservice, how do I refresh the data on an event?

as you can see I have a function called refreshGrid().  It gets an instance of the grid successfully.  I know this because the cancelChanges() call works.  But when the refresh() is run nothing happens.  I'd like the grid to re-call the webservice and reload itself.

Thank you in advance.


function refreshGrid()
{
    // get a reference to the grid widget
    var grid = $("#grid").data("kendoGrid");
    // refreshes the grid
    grid.cancelChanges();
    grid.refresh();
}
 
 
function SetWindow(val)
{
    $("#window").kendoWindow({
        title: "Async Window Content",
        content: "popup.aspx?id=" + val,
        visible: false,
        close: refreshGrid
    });
}
 
 
 
$(document).ready(function () {
 
    $('#target').click(function () {
        SetWindow(34);
        var window = $("#window").data("kendoWindow");
        window.center();
        window.open();
    });
 
 
    $("#grid").kendoGrid({
         
        columns: [
                { title: "Action", command: "destroy" },
                { field: "ID", visible: false },
                { title: "Status", template: "<A href=;pop.aspx?id=${ ID }'>${ JobRate }</a>" },
                { field: "Name" },
                { field: "JobRate", title: "Job Rate" },
                { field: "Notes" }
            ],
        editable: true, // enable editing
        toolbar: ["create", "save", "cancel"], // specify toolbar commands
        dataSource: {
            schema: {
                data: "d", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
                model: { // define the model of the data source. Required for validation and property types.
                    id: "ID",
                    fields: {
                        ID: { editable: false, nullable: true },
                        Name: { validation: { required: true} },
                        JobRate: { validation: { required: true }, type: "number" },
                        Notes: { validation: { required: true} }
                    }
                }
 
            },
            batch: true, // enable batch editing - changes will be saved when the user clicks the "Save changes" button
            transport: {
               },
                read: {
                    url: "JobsWebService.asmx/GetAllJobs", //specify the URL which data should return the records. This is the Read method of the Products.asmx service.
                    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") {
                        // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                        return JSON.stringify({ products: data.models })
                    }
                }
            }
        }
    });
Jeremy
Top achievements
Rank 1
 answered on 20 Feb 2012
2 answers
445 views
hi,I just write like the example, my servlet have receive the upload file and wirte to the disk successfuly.but after i upload the file,it says unexpected server response.here is my script and html code:
<script type="text/javascript">
function onSuccess(e) {
var window = $("#message").data("kendoWindow");
window.center();
window.open();
window.content(e.response);
}
$(document).ready(function() {
$("#message").kendoWindow({
visible : false,
width : "400px",
height : "200px",
draggable : false
});
$("#headImg").kendoUpload({
multiple : false,
async : {
saveUrl:"${pageContext.request.contextPath}/doUpLoadHeadImg",
saveField:"headImg",
success : onSuccess
}
});
});
</script>
<input type="file" id="headImg" name="headImg" />
T. Tsonev
Telerik team
 answered on 20 Feb 2012
1 answer
118 views
Is it possible make dynamically loaded listitems clickable?
Petyo
Telerik team
 answered on 20 Feb 2012
3 answers
274 views
Is the slideDown effect supported for the autocomplete. I cannot get any combination to work for a slide opening effect?
Only fadeIn seems to work.
Kamen Bundev
Telerik team
 answered on 20 Feb 2012
2 answers
168 views
I followed closely the online example, while both main and sub queries work perfect. The sub template folds out properly but for whatever reason it does NOT show any data, just the header lines. There are no errors in the console, also removing all extra datasource options including the filter does not help. I am a bit lost here and do not know how to debug it.
underscore
Top achievements
Rank 1
 answered on 20 Feb 2012
2 answers
164 views
When the page renders on an iPhone or iPad it initally loads without any stylesheets applied for a brief moment, then it redraws with the stylesheets.  Can someone tell me how I can prevent that initial load without the stylesheets applied?

thanks!
Richard
Top achievements
Rank 2
 answered on 20 Feb 2012
1 answer
110 views
Hello,

How can I show a kendo datepicker in a x-kendo-template?
And can I use validation in the same template?

Thanks in advance,
Martin
Petyo
Telerik team
 answered on 20 Feb 2012
3 answers
237 views
Hello,

Simple question : when i add a tab by javascript, is it possible to put HTML instead of simple text for the tab's title ?
I want to ad a close button in fact.

Regards,
Guillaume
Kamen Bundev
Telerik team
 answered on 20 Feb 2012
1 answer
167 views
Hi,

I'm wondering if you have an event when kendo is done with it's adding of css to my html.  I'd like to make some changes once that is done.  Right now they get over written even though I have this on the FIRST line in the $(document).ready.
var app = new kendo.mobile.Application(document.body, { layout: 'main', transition: 'slide' });
Petyo
Telerik team
 answered on 20 Feb 2012
1 answer
289 views
Will there be a Javascript-Function to detect the geo-data like latitude and longitude of the mobile device?

In jqTouch, for example, you receive it this way:

var lookup = jQT.updateLocation(function (coords) {       
        if (coords) {
            lat = coords.latitude;
            lng = coords.longitude;         
        }
}
Kamen Bundev
Telerik team
 answered on 20 Feb 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?