Telerik Forums
Kendo UI for jQuery Forum
0 answers
45 views
Hi,

I would like to handle saveChanges on grid myself as I want to send additional data to server. So far, this is what I have done:

var allData = stateMap.projectStaffDs.data();
                   var models = $.grep(allData, function (item) { // grab only dirty rows
                       return item.dirty;
                   });
 
                   // save
                   var xhr = $.ajax({
                       type: "POST",
                       cache: false,
                       url: document.getBaseUrl() + "/Services/SaveStaff",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       data: JSON.stringify({ data: models, workspace: stateMap.userWorkspace.workspaceName }),
                       success: function(data) {
                           console.log("project staff saved");
                           $.Topic("spa-notification").publish(spa.util.makeLogItem("success", "Successfully saved!"));
                           $.Topic("project-staff-changed").publish( stateMap. );
                       },
                       beforeSend: function(xhr) {},
                       error: function (xhr, textStatus, errorThrown) {
                           console.log(errorThrown);
                           $.Topic("spa-notification").publish(spa.util.makeLogItem("error", "Failed to save data!"));
                       }
                   });


My concern now is, after I save changes on the server, how to update the DataSource locally so that if reflects no changes and that all changes saved?

More or less, I want to call "sync()", but would that update the datasource locally?

Thanks
Bilal
Top achievements
Rank 2
 asked on 28 Mar 2015
7 answers
1.0K+ views
Hi,

1. We are using a kendo-window as a modal popup and applying a tabbing provision inside it by applying tabIndex property.

Consider a scenario a popup window with 4 controls. When a 'tab' navigation reached to a control having a maximum 'tabIndex' number and if we still press a tab in that case 'Tab' control tries to focus a control out of that window (control from parent page) . So we wanted that once we are in window 'tab-index' should not focus out of that window. 

So how can we achieve that?

2. Another help that we would like to have is that we wanted to avoid 'window-drag' on arrow keys but we wanted to have it on mouse-drag. I tried it with 'draggable : false ' but in that case we are not able to drag that window using mouse. So how could I achieve that.

Thanks,
Pushkar  
Pushkar
Top achievements
Rank 1
 answered on 28 Mar 2015
3 answers
964 views
Can anyone give me an example of how to create a kendoui radio button group  and get the button labels and button values from an MVC Ajax controller data source?

The radio buttons need to be bound to an MVC model, so the RadioButtonFor(expression) format would be the most useful.
T. Tsonev
Telerik team
 answered on 27 Mar 2015
1 answer
207 views
I'm fairly new to KendoUI and was intrigued on the idea of building an SPA in Visual Studio.  After hunting around the internet I found a few different approaches and eventually found a project template that someone made: https://github.com/vbilopav/WebBoilerplateTemplate/.  This template is based on a few other similar templates are basically the same.

As I poked around I started to get an idea of how the routing, views and layouts.  For simple development everything ran smoothly but then I tried to add the sample grid provided by Telerik and started scratching my head (http://docs.telerik.com/kendo-ui/web/grid/how-to/kendo-grid-in-spa-application).  For the sake of just merely learning can you provide me an example on how I would implement your kendo-grid in this project?  I'm just trying to add a dummy grid to the details view.
Alexander Popov
Telerik team
 answered on 27 Mar 2015
1 answer
109 views
Hello,
I've found this strange behavior and I can't figure out if it's a bug introduced with the new kendo version ...
see the example:

http://dojo.telerik.com/EXiNi

click "New Record"
then change the Category selection ... nothing is fired
change again the category selection ... now fires "change"

in the previous version this behavior was different
it fires "change" also on the first "change" .. even if the selected value is null (as a new record)

Thank you
Georgi Krustev
Telerik team
 answered on 27 Mar 2015
1 answer
127 views
Hello,
I've found this strange behavior and I can't figure out if it's a bug introduced with the new kendo version ...
see the example:

http://dojo.telerik.com/EXiNi

click "New Record"
then change the Category selection ... nothing is fired
change again the category selection ... now fires "change"

in the previous version this behavior was different
it fires "change" also on the first "change" .. even if the selected value is null (as a new record)

Thank you
Georgi Krustev
Telerik team
 answered on 27 Mar 2015
2 answers
135 views
I follow guide in documentation. I build 2 views.
On first view is some text and on second is kendoEditor. When I navigate to the second view kendoEditor is working. Then I navigate again to first view and again to second view and kendoEditor is not working. It is not getting focus event, nothing.

The first time I get to second view editor source code is in attachment 1.
The second time is in attachment 2.
Dimo
Telerik team
 answered on 27 Mar 2015
4 answers
370 views
I have a view that is using a kendo.observable with a datasource wired to call a .NET MVC ActionResult that returns Json data (both the view and the ActionResult are in the same domain.  I tried using jsonp to see if anything shook out differently, but no dice.)

$(document).ready(function () {
     var viewModel = kendo.observable({
        data: new kendo.data.DataSource({
            transport: {
                read: {
                    url: "GetCardOrder?shipSuffix=123123123",
                    dataType: "json"
                }
            },
            batch: true
        }),
    });
    kendo.bind($("#order_details"), viewModel);
    viewModel.data.read();
});

further up in the html  view I am binding an html element to a value that is going to return from that GetCardOrder call:
<div class="col-sm-6 col-md-5">
     <label>Group:</label>
     <span data-bind="text: data.Group"></span>
</div>

I have verified using fiddler that the ActionResult is being called and it is returning a valid block of Json data (specifically the Group value shown above).  However, when I debug the javascript after the .read is called, the datasource has 0 data, and thus nothing is being updated in the view.

It's entirely possible I am missing something basic here.  







Alexander Popov
Telerik team
 answered on 27 Mar 2015
2 answers
187 views
I have a problem with the format of dates.

format: "{0: MM / dd / yyyy HH: mm}" - all good
format: "{0: dd / MM / yyyy HH: mm}" - editing does not work

thank you for your help
Bozhidar
Telerik team
 answered on 27 Mar 2015
7 answers
155 views
Hi,
I am trying to implement the persist state feature of Kendo Grid in my LightSwitch app. For testing purpose I have two button on the screen, one is to save the state:
myapp.ContactsBrowse.saveGridState_execute = function (screen) {
    var grid = $("#grdContacts").data("kendoGrid");
    localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
};

another is to load the state:

myapp.ContactsBrowse.LoadGridState_execute = function (screen) {
    var grid = $("#grdContacts").data("kendoGrid");
    var options = localStorage["kendo-grid-options"];
    if (options) {
        grid.setOptions(JSON.parse(options));
    }
};

This works if I remain on the same screen, but if I go to a different screen & then come back & try to load the state is doesn't work.
Divyang
Top achievements
Rank 1
 answered on 27 Mar 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?