How to capture "Select all" event of context menu in plain javascript - contextmenu

I have an HTML canvas application. I want to support right click "select all" command. I added an textarea on top of canvas to capture text editing events like cut, copy, paste and select all. I can capture all other commands using "oncut", "oncopy", etc., except "Select all" which I could not find the corresponding event for it. What I plan to do is that when user right click on textarea then click "Select all", my event handler is called and do a "Select all" in my canvas.

I have found the answer: "Select all" context menu command will fire onselectstart event.

Related

Capybara + Poltergeist + Phantomjs. Unable to click a button

i have a button, upon clicking it will change the display of a div from none to block. I wanted to click on the button, have the div displayed as 'block', click "Done" and then the div's display become 'none'. Capybara was able to click on the 1st button but it couldn't seem to find the 2nd button "Done". I tried several ways:
click_on("Done")
find_button("Done").trigger('click')
find_button("Done").trigger('click')
find_link("Done").trigger('click')
I even tried to use javascript:
page.execute_script("document.getElementById('button_done').click()")
but nothing happens. I printed out the display property of the pop-up div prior to the clicking "Done" and after the clicking to check if the button was click but both statements gave me the div's property as 'block' (expected 'block' before clicking "Done" and changed to "none" after the clicking).
I allowed it to sleep(10) but doesn't seem to help.
I used the same javascript on the page console and it worked as it should be.
Any inputs?
Thanks
EDIT:
feature:
Given I click on "Create an item"
And I chose an option
Then I should be able to create an item
steps:
step "I chose an option" do
within ('#web') do
click_on "On"
end
sleep 3
#Here is where the div gets displayed with the 'Done' button
find('#button_done').click #(doesn't work though)
sleep 3
click('Create')
end
try find('selector', :visible=>false)

Combo box not focusable

Is there any way we can set the combo box not focusable? Because every time I select an item from combo box (drop down list), the keyboard shows up and the text from drop down list can be edited. I can't find any property from property inspector to disable this up. Or maybe we can disable this one programmatically in which I don't know.
Consider using an Option Menu (unlike a Combo Box an Option Menu has no field which a user can type into - and therefore no unwanted appearance of the keyboard)
Dave
The default script for a combo box is a menuPick handler. Whether or not you use the functionality of that handler or not, you would add this line at the end of that handler:

Excel 2010, how to keyboard shortcut to filter dropdown checkboxes?

For Excel 2010, when I have the filter drop-down open
...how do I get to the filter checkbox section via keyboard shortcut? Skipping everything from "Sort A to Z" to the "Search" box, going all the way to the checkboxes.
Quickest Option: e ↓
In Excel 2010 (English) you just have to press e to get to the filter textbox; from there you can use the down arrow key ↓ to go to the first checkbox:
Alternative Option
Shift+Tab
Shift+Tab
Shift+Tab
(as mentioned by #Sean_Cheshire) - this goes "backwards" from the first entry over "Cancel" and "OK" to the first (sic!) checkbox.
Related Question: How to open the filter drop-down
The question above is about how to move inside the filter drop-down. To open the filter drop-down, you have one or two options:
For any filter: As #Juhi and #Josh have pointed out, you can open said menu with the keyboard when the column heading cell (where you would click to open the drop-down) is selected by typing Alt+ ↓ .
For tables: If you are using a Table object instead of a pivot table or regular filtered range, you can be in any row of the Table and open the filter drop-down using Alt+Shift+ ↓
ALT+DOWN arrow key opens the selection box. Use the arrow keys to select an option and SPACEBAR to "check" or "uncheck."
Try ALT+down. It opens the drop down list in filters and cells as well.

How to create a rails drop down menu which triggers either a text area or an upload form

I would like to create a rails drop down menu, with two options: "Upload file" and "Write text". When "Upload file" is selected, an upload form will appear on the right hand site. When "Write text" is selected, an text area appears instead.
Thanks a lot!
Well there are many ways you could go about this, but I would just display the view as normal (but hide one of the elements to begin with) and attach a jquery event to the drop down menu. You can then show/hide the element within the event handler based on the value selected. Take a look at http://api.jquery.com/change/, http://api.jquery.com/hide/ and http://api.jquery.com/show/ to get started.

"Hello, world!" example for DevExpress QuantumGrid?

I successfully installed the latest QuantumGrid from DevExpress, but I've never worked with this grid before, and I don't know how to get started. I find that the HLP file isn't really a tutorial, and the demos are so rich to the point where I can't get started quickly and see if QuantumGrid fits my needs.
Would someone happen to have a really basic example on how to create a small, non-DB-bound, non-hierarchized, but user-editable grid to host a couple of columns and fill the grid with a few rows?
Thank you.
Place a grid on a form, then delete its default GridView and add a TableView. Add a few columns to TableView and then associate your GridLevel with this new view. Place a button on form and add this code to its click handler.
cxGrid1TableView1.DataController.BeginFullUpdate;
try
cxGrid1TableView1.DataController.RecordCount := 3;
cxGrid1TableView1.DataController.SetValue(0,0,'Data1');
cxGrid1TableView1.DataController.SetValue(1,0,'Data2');
cxGrid1TableView1.DataController.SetValue(2,0,'Data3');
finally
cxGrid1TableView1.DataController.EndFullUpdate;
end;
RecordIndex corresponds to the row index and ItemIndex corresponds to the column index. I hope this helps you to get started.
Create a table
view(gridlevel->create view->table)
Create columns(double click cxgrid
and add)
Set property(inner controls like
DateEdit) if you want. default
property is textedit)
You can insert/delete via
TableView.DataController.Insert/TableView.DataController.Delete*
or use navigator(View->OptionsView->Navigator)
You should look at demos("quantumgrid directory"\Demos\Delphi), demos are more helpful than help files :)
Thanks guys for the help. For those interested in getting started with this grid object, here (what I think) are the steps presented above:
(idursun)
Add a TcxGrid object to the form
In the Structure object in the IDE, right-click on cxGrid1, and select "Delete View"
Right-click on cxGrid1, and select "Editor"
Click on the "Views" tab, click on "Add View...", and select "Table" in the drop-down list
In the "Columns" tab on the right, click on "Add", and add a few columns
Still in this dialog box, go back to the "Structure" tab on the left
Right-click on cxGridLevel1, and choose "Select View" to associate the Level with this new TableView. Close the dialog
In the form, add a button, and paste this code to its Click event:
cxGrid1TableView1.DataController.BeginFullUpdate;
try
cxGrid1TableView1.DataController.RecordCount := 3;
cxGrid1TableView1.DataController.SetValue(0,0,'Data1');
cxGrid1TableView1.DataController.SetValue(1,0,'Data2');
cxGrid1TableView1.DataController.SetValue(2,0,'Data3');
finally
cxGrid1TableView1.DataController.EndFullUpdate;
end;
(barism)
Add a TxGrid object to the form
Within this new cxGrid1 object in the form, right-click its cxGrid1Level object, and select "Create View > Table"
In the Structure object in the IDE, right-click on cxGrid1, and select "Editor..."
In the Columns tab on the right, click on Add to add a couple of columns. Close this dialog
To add data to the grid, either write code, or right-click on cxGrid1 and select "Edit Layout and Data"

Resources