KendoUI Grid - Line disappears when canceling editing - kendo-ui

I have a grid, without ajax transport. I just use put item directly in the MVVM. I can create and edit lines into it. But wen I edit a line that I've just created and then I cancel the edition, the line is deleted.
An example says more than a thousand words : http://dojo.telerik.com/oREqi/2
Is this behaviour normal? I don't think so...
What's the cure?

Related

Kendo UI Grid inline edit not work when use ObservableArray as data for data source

I'm trying to use a kendo.data.ObservableArray as data for data source of the grid. It shows ok. When edit inline, change a field, then cancel, the values are changed. When clicking edit, then click edit on another row, the last one remains in the edit mode. Sometimes cancel not work. On the array it works as expected.
I took the Kendo UI Demo, http://demos.telerik.com/kendo-ui/grid/editing-inline, to reproduce the issue. Here is the issue: http://dojo.telerik.com/uLiCi/2
Does anyone have any idea why so strange behavior?
In my opinion, it should work with both, array and observable array.
Thanks in advance

Toggle validation hide(+) when other in open(-) SSRS

I am developing a "Dashboard Report" in SSRS Visual Studio 2010. I Am trying to put 8 charts graphs at the same location. Each chart must open from each textbox I assigned a toggle. Each chart has the visibility as Hidden and display by textbox name.
Now I am trying to make a validation which determine that only one chart must show at the time. Because when I try to see an individual chart always I have to close which was open before.
I have created a parameter to assign an InitialToggleState Expression, but I haven't succeed.
I will appreciated any good suggestion step by step. Thanks
Have you considered using a Hidden parameter to control which chart is open? By defining one you can use the textboxes to control an identifier for which chart you wish to display.
Method
First define a Hidden Pameter by creating a new parameter and setting the visibility to ‘Hidden’. I have created one called OpenChart
Create your charts (you have probably already done this by the looks of things. Set each charts visibility to be equivalent to
=iif(Parameters!OpenChart.Value = 1, false, true)
Changing the value ‘1’ to a unique number for each chart
Create your control buttons, possibly using text boxes. Create as many buttons as there are charts to disaply (you’ve probably done this already too). For each button Set the action to be a reloading of this report, using the same existing parameters, but with the OpenCahrt Parameter set to the chart identifier set in 2. Above
The report now looks like this (for 3 buttons)
Result
When the report is run and the ‘One’ textbox is clicked the output looks like this
And for 'Two' like this
And so on...
You don’t have to put the charts side by side of course, they can be layered on top of each other. I only laid them out like this for clarity.
Hopefully this will help save you from trying to validate all the charts are closed before the next one is open, because only one can be open at a time.
Please let me know if you need further clarification

Kendo UI TabStrip e.preventDefault() doesn't work

Two problems:
1.)
e.preventDefault() doesn't work correctly with Kendo UI TabStrip when somewhere
$("#tabstrip").kendoTabStrip().data('kendoTabStrip');
appears.
2.)
Imagine the User clicks on another tab, but has unsaved changes.
A dialog pops up and ask if he wants to discard the changes and go to the tab or
if he wants to stay on the active tab to save his changes.
My solution doesn't work. Because of the 1. Problem I guess and because
.data() somehow reinitialises the TabStrip?! What is wrong?
Here is a (not) working example
http://jsfiddle.net/Nakkvarr/w9586/
Any ideas on this issue?
The reason it doesn't work for the first tab is because you initialized the tab strip twice on the same element $('#tabstrip'). Since you bound the select event on the first initialization, the subsequent initialization overwrote it (the select event isn't handled anymore). You even answered the problem yourself by stating that it works if you comment the second initialization line out.
I'm not entirely sure what you're trying to accomplish with the setTimeout() function in the second example. It's unnecessary.
Using e.preventDefault() works as expected. JSFiddle: http://jsfiddle.net/w9586/6/

Combining Radgrid, RadajaxPanel, ValidationSummary and a custom "turn field in error to red" issue

Here's the format of a sample page :
*Validation Summary*
Label : [input]
Label : [input]
###############
# RadGrid #
###############
###############
# RadGrid #
###############
Label : [input]
[save button]
1st version :
When I push the save button, the whole page reloads. The validation summary is filled with errors (or not) and the input that are in error are shown in red.
When I open a RadGrid (custom edit template), the whole page reloads and the save button is desactivated.
Problem : The whole page is reloaded when we open a grid and it's uhh... not what the customer wants...?
2nd version :
We have put radAjaxPanel around the radgrids, so when you open a grid, only the grid reloads. Problem : The save button is not desactivated anymore.
If I click the save button, the whole page still reloads.
3rd version :
We added a radAjaxPanel to the save button and a line (see footnote) to reload this radAjaxPanel when a RadGrid is opened or closed
Now the button is activated/desactivated properly.
Problem : When I push the save button, only the button reloads and if there are error on some fields, they are not turned to red. The validation summary still work.
4th version :
Added a line (foot note) to reload the whole page when the save button is pushed.
now the field in error are turned to red
Problem : this extra postback make the validation summary dissapear.
So, any ideas on how could I have all these options working together?
The easy way out would be to convince the customer to abandon radAjaxPanel (because I feel we use them incorrectly anyway and it brings little advantages).
The whole project architecture is somewhat complex (we emulate .net mvc with webforms (!)) and I feel like code would just add cluttering to the questions, but if you think some specific parts would need more details/code, feel free to ask.
MainRadAjaxPanel.ResponseScripts.Add(string.Format("$find('{0}').ajaxRequest();", MainRadAjaxPanel.ClientID));
I recommend using the RadAjaxManager control instead of several RadAjaxPanels. The RadAjaxManager allows more flexibility around what item(s) are triggered by what control(s). Unfortunately I can't give specific example with the information above but hopefully this will get you pointed in the right direction. You can definitely do what you're wanting with the RadAjaxManager and get everything working. Just be mindful of AJAX triggers and updates, i.e., what control triggers an AJAX update (e.g. your save button) and what receives the corresponding update (your ValidationSummary).
http://www.telerik.com/help/aspnet-ajax/ajax-ajaxmanager.html

jqGrid form edit stuck with initially loaded values

When I open form to edit values:
It doesn't change form values when I navigate with <> buttons
It opens New form with same values as first edited row, and when I click "Submit", it overwrites that row instead of creating a new item
When I click to edit another row, it always shows the form values for the first edited row – i.e. if I click New first and then edit row, it shows empty form.
So, in short, the first time form opens, the values are "stuck" whatever row I open later.
What can cause this? I remember it used to work OK some time ago.
UPDATE:
No with recreateForm I don't have this issue (I use it as temporary workaround).
Hm, I can reproduce this on jqGrid example, but not on Live Manipulation - on New in Version 3.7, Add/edit/delete on local data:
Click any row and edit it (open form)
Close form
Select any other row and click edit - form shows incorrect values (from the row that was opened first)
Click Add new row button in toolbar - form shows same values - which is very convenient, usually new rows are "almost" same - if only it would add new row, not update the existing one!
Of course in live demo Submit doesn't do that (it doesn't seem to work at all) but except for this symptoms are same.
Also <> buttons do not change data in form, though they change selected row - but from what I remember previously it used to update form values also to match selected row.
Probably you should post the description of your bug with "New in Version 3.7", "Add/edit/delete" as a bug in the in trirand forum.
The problem is that the bug exist in very special environment/data/settings. For example I tested my old local edit example modified to jqGrid 3.8.1 or in 3.7.2 and can not reproduce the problem which you describes. So you can use my examples as a template could it helps you.
Moreover in all examples which I use for real projects I use always parameter recreateForm:true. If you don't use it jqGrid not create a form, but try to use an existing with other data. It works in a lot of cases wrong. For example if you use any dataInit functions they will be called only once during creating of the form, which can make very strange affects. If you use edittype: 'custom' the usage of recreateForm:true is really mandatory (see this). So I recommended many times all people to use
jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});
to set recreateForm: true as your default settings. You could save many hours or days of debugging of some strange effects in your edit/add dialogs.

Resources