Dojo/HTML equivalent for list box control - widget

We are porting our MFC based client to Dojo. Is there any widget similar to listbox control. At present I am using DataGrid, but that seems heavy and overkill for our purposes. Alternatively what is best widget to replace listbox.
Update: I have already looked at dijit.form.multiselect, and I dont think that meets my requirement. MFC Listbox typically looks like this. I dont see (or rather dont know) how to replicate this with multiselect. It is possible that DataGrid is best fit for the control.

If you use dojo 1.7, take a look at the new DGrid.
For an example looking like yours, go to the tests page and pickup the Selector.html example.

Here are some options depending on which part of the ListBox you want to create:
dijit.Dialog to create a basic dialog box.
dijit.form.FilteringSelect to create a drop-down with your options (single select only).
You could also use radio buttons or checkboxes for your options depending on whether multiple selections are allowed.

Related

Dropdown select with delete option next to each option value

I need to implement a drop-down which has a delete 'X' option next to each option item. Somewhat like the image shown below.
The drop-down is populated dynamically and I need a way that does not inlvolve using list as an alternative.
EDIT: The icons next to each dropdown item refers to 'Edit'/'Delete'
You cannot put a checkbox into the usual <select> or multi-select HTML element.
However, here is another question where several good options are discussed.
This looks like the most useful and best suited to your purpose:
https://stackoverflow.com/a/27547021/1447509
And here is an example of how to change the default checkmark to an X:
https://stackoverflow.com/a/40123793/1447509
Sources:
How to use Checkbox inside Select Option
After selecting check box Instead of Tick symbol need X in html
UPDATE:
Given that you need both the HTML markup and the javascript to make it do what you want, you have two (possibly 3) steps to do:
This answer provides a good example of how to create the custom-rolled <select> control.
This answer shows you how to replace the checkbox created in step 1 with an icon/image of your choosing.
The javascript to remove the x'd <option> is very simple:
$(this).closest('option').remove();
IF you also need to save these results, then you also need to learn:
4a. Server-side SESSIONS (so that each user's customizations are saved for them)
4b. A login system, so you know for which user to save the current customizations.
4c. Just the basics of how to use a back-end database, such as MySQL/MariaDB, in which to store the user customizations.
4d. AJAX - so you can schlep info to the back-end for insertion into the database without refreshing (or navigating away from) the current page. AJAX replaces the ancient and no-longer-used <form> construct. Frankly, once you've used AJAX a couple of times, you'll never go back. Totally easy.
If you are in a bind and need someone to create the whole thing for you, I refer you to one of these websites - I have used such services myself and can recommend them.

How to use the same ViewModel for different Pages (views)

I am searching for a way to use one ViewModel for two different Views (Pages). I know there is Multi-view support in Caliburn.Micro and I read a lot of it but I'm not sure if it is what I am looking for or how it works on Windows Phone.
Currently, I have one View ItemPage.xaml and one ViewModel ItemPageViewModel. I use this View/ViewModel to add a new Item and display an existing Item. Depending on the mode (add, show, ...) I need to show/hide or enable/disable some UI elements and display different AppBar buttons.
Instead of control these UI elements by binding to properties, I want to create two seperate Pages(Views) with the corrrect UI elements.
It would be nice to use the same ViewModel for both Pages to avoid repitive code. So is my use-case above possible with Caliburn.Micro for Windows Phone?

filteringSelect with multichecked

is there any ready widget like that?
If not, can I combine the dijit filteringSelect with dojox multichecked?
if not, is it easy to create one of my own or has any one started doing this? it's so necessary for my project.
There is no widget like that as far as I know (the multichecked widget itself is not even a standard widget, since it's a part from DojoX).
About your question of combining both. I don't think that will be easy, because the dijit/form/FilteringSelect does not use a <select> as widget and I don't think they're made to be ran together.
And the answer to your last question: it all depends on what functionality you exactly need. A dijit/form/FilteringSelect only allows you to select 1 value (it's a textbox with a dropdown in fact, and a textbox can only have 1 value).
If you want to create a variant with radio buttons, then that is possible, but it is not an easy job. The multichecked is working with a simple DOM node, however, the dijit/form/FilteringSelect offers a lot more things like autocomplete, stores, ... . To make your widget work, you need to listen to all these events and adapt yuur radio buttons to it.
I made a simple example that is only displaying radio buttons for each item in the filtering select, the code can be seen at JSFiddle. However, it does not react to changes, that's a part that you will have to implement.

select multiple form

how can i make a form where you dont need to hold down control key to select multiple options ?
i want to make it so that when you just click on any of the options, they will be highlighted.
Create a list of checkboxes instead of using a list box:
http://www.siteexperts.com/tips/html/ts16/page1.asp
This List Box containing checkboxes will also work:
JavaScript ListBox Control
http://www.codeproject.com/KB/scripting/List_Box.aspx
I don't think it's an option in regular html. I'd suggest, though, that in many cases it might be easier to use checkboxes to allow for multiple items in the same list to be selected. To my mind it's also easier from a UI point of view.
Perhaps Javascript has an option, though? I wouldn't be surprised.
Or you could even use dragable checkboxes.
You can also do this using JavaScript if you want to keep the ListBox rather than use CheckBoxes.
I'd use jquery for any kind of custom ui or form elements. There are tons of form plugins for jquery. Check it :)
http://plugins.jquery.com/project/Plugins/category/20

Access 97 - how to edit/explore existing toolbar?

My current job is updating an existing Access97-Project. I haven't worked with Access in a long time and i can't find out, how i can explore a toolbar called "sbmbDrucken" which is obviously user-created. I just need access to the action or the code which is called by the buttons...
Is there any menu entry i missed or do i need special code for self-inspection?
TIA!
There are three different ways for menus/toolbars to be instantiated:
the old way, using macros. Before A95, this was the only way, so a lot of older apps (i.e., those converted from earlier versions) may still use macros for the menus.
defining them by hand, using the CUSTOMIZE function that you get when you right click on a toolbar in Access.
in code, using the Application.Commandbar object.
For the first you can browse your macros and see if any of them are menu macros.
For the last, you can do a search in the code for CommandBar.
For the second, just look at them through the built-in menu customization tools. Keep in mind that you may have to check them off to get them to be visible, and that the list is in no rational order. Likewise, some menus/toolbars are hidden from the customization interface. Also, you might need to look at the CUSTOM toolbar menu item.
I don't have Access 97 on hand but you may take a look of this webpage: http://www.alvechurchdata.co.uk/hints-and-tips/accaddtoolbar.html
It seems that "user-created" toolbars could be defined by handwritten code at form.load or somewhere similar. You may search CommandBars.Add and see if you can find those relevant code segments.
Hope that helps.
In the design mode, you will be able to see the toolbar & actions assigned to each of the button.
Right click on the specific toolbar
Click on Customize...
Right click on the button you would like to edit the action of.
You will be able to see the action (which could either be macro or code).
Let me know, if that doesn't help at all.