Users are Mad! Wijmo Grid AfterCellUpdate not triggering - datagrid

I have a editable wijmo grid that works pretty good but there is a problem that continues to stump me and makes users upset.
When you double click to edit a cell, after it's been edited, the AfterCellUpdate (AfterCellEdit or any other) event is never triggered if you click anywhere on the page that is outside of the actual grid; events do fire if you click inside the grid.
This has proved to be rather inconvenient since I need to process the underlying data every time cell data is changed and it is common for a user to double click, edit the data, and then click the save button without clicking inside the grid (and it makes sense to me that they should be able to do that).
Of course, the data doesn't get saved because it doesn't appear to have been changed in the data source; this doesn't make them happy :-)
It does save the data properly if they click in the grid and then click save.
Can someone PLEASE shed some light into this rather perplexing issue???
BTW, I saw similar behavior in some of the sample code that comes with the product; I mean when editing if I clicked outside the grid it stays in edit mode on the cell being edited.

Wijmo grid saves the data when the current cell changes. To save data on clicking the save button without having to click inside the grid, you could call the endEdit method of the grid on the save button click.
$("#btnSave").click(function(){
$("#grid").wijgrid("endEdit");
});

Related

Click button on element popup

Okay so I am trying to create an automation to click on a button once it appears. I was able to find the code within a javascript source file in the website's code files that creates the element that contains the button in question, however it is not always there. It is generated once a trigger on a different UI is enabled, then it shows up on my end. I want it to automate clicking the button as soon as it appears.
Is there a way to do this? I am super new to code.
An example of what I am trying to do:
Someone in one UI creates an account that needs to be approved, it pops up an element on my end with an approve or deny button. I want to automatically and basically instantaneously click one of those two buttons any time it appears.
This is not exactly what I am trying to do, but it is similar. I do not own the website I'm trying to go this on*
I have no clue what I'm doing at all....

Tooltip becomes broken after editing value in the grid's cell - ExtJS6

We have encountered a subtle issue with ExtJS grid.
It is quite regular grid with standard 'cell editor' plugin and two editable columns (having at least two is important).
Once an editable cell is submitted, the store backing the grid gets reloaded.
However grid reload takes place in a subsequent time slot because it's a part of asynchrouous task completion.
All this works well unless the user submits editable cell with the Tab key rather than with Enter. Tab makes second column's cell editor visible and shifts input focus there. After that the store reloads, or at least I believe it happens afterwards.
At first glance nothing bad happens to the UI, it continues working as usual. However after some time an attempt to hover the mouse over any element to which a tooltip is attached causes crash and console gets flooded with errors.
We've been able to establish immediate reason of this: garbage collection cycle that follows grid reload treats the input field belonging to the second column's editor as garbage. As a result Ext.Element instance wrapping this field has its dom property erased. By itself it's seemingly not an issue. However, for some reason, when it comes to show a tooltip, the system tries to get its hands on the Element that was previously garbage collected. Strangely enough, that element has nothing to do with tooltips.
In order to reproduce this open the fiddle and then
Double-click any cell in the first column to make it editable
Type any value
Press Tab on the keyboard
Wait 30 seconds
Move and hover the mouse over the grid cells to view tooltips
It does not need to be a grid tooltip, the bug equally occurs even if the mouse hovering over any unrelated UI element with tooltips.
So the question is: how can it be that garbage-collected element is reused, and how to correct this?

No event getting generated on button click in MFC

I have a dialog based application. I have one static text control and a button on this, both of which I have made invisible in the beginning. I want to show both the controls on reaching a certain condition. When I click this button, again I want to make both the controls invisible.
However, I am able to show and hide the control and also captured the button click event like this:
ON_BN_CLICKED(IDC_MY_BUTTON, &MyDlg::OnBnClickedMyButton)
and defined OnBnClickedMyButton().
But when I press the button, it is not pressed and the event is also not generated.
Any suggestions?
First check if the IDC_MY_BUTTON exists and is valid.
Remember to add DECLARE_MESSAGE_MAP() at the header file.
Also check at the BEGIN_MESSAGE_MAP(MyClass,MyParentClass) if the class
and the parent class you write are right.
I hope this helps.
I think the IDC_MY_BUTTON maybe is invalid or other control has the same ID.
Well, finally I have come to know that though the button was visible but on clicking it was not taking control, hence I used BringWindowToTop() to draw it on top. Now it is being clicked and OnBnClickedMyButton() is also being called.
But now the issue is that after calling BringWindowToTop() the button is not shown. It is shown only when I take the mouse pointer on it. Not able to understand what is the issue.

How to implement excel-like formula editor in XtraGrid?

I'm working on complicated system, which allows some values in grid to be calculated by formulas.
Right now I have textbox control above grid.
It works in this way:
When you start editing inside in-place editor and first symbol is '=' - focus is moved to that textbox control above.
At this moment grid is made readonly, and when user clicks on grid cells - coordinates of the clicked cell are passed to formula editor, so it can add links to formula. When you press Enter or Esc in text editor - formula is being written to underlying dataset and grid is made editable back.
The goal:
I want this too look more like Excel grid. Don't like focus to jump somewhere outside.
Is it possible to keep editor open and at the same time allow user to click anywhere on grid? So, all formula editing will be performed inside inplace editor?
Right now, there's no event to disallow closing editor. If I use 'ValidateEditor' event - it doesn't even allow to use scrollbars.
Is there a way to keep editor open and leave navigation working?
Seems I have found way round that myself.
I handle ValidatingEditorEvent, and if edit value starts with '=' I set boolean flag in my control. Also, I remember text before and after cursor position, and cell coordinates (FocusedRowHandle, FocusedColumn).
When I receive Click event, I get clicked cell coordinates and if boolean flag is set - I focus previous cell, activate editor and add what I need to inpalce editor.
Seems to work fine.

ListView Edit item Position

I have a Listview in my aspx page with Insert template and Edit template. and a Add New LinkButton.
When a user clicks on Add New LinkButton I am able to specify Insertitem Position so that the Insert TEmplate appears at the bottom of the listview. But how to I make the edititem template to appear at the bottom like the Inserttemplate
Its not available for the EditItemTemplate.
You'd have to actually save the original position, move the item in the data source itself (probably IList compatible), rebind the view, trigger editing on the new position, then swap the data item back to the original position.
I wouldn't recommend it. It's nonintuitive behaviour for users anyway; when I decide to edit something I should either be able to edit in place or edit on an entirely separate form. It's very rarely good UI design to shuffle items around while users are working on them, especially if you have any sort of scrolling/paging going on.

Resources