Different Editors for one column in EditorGridPanel ExtJS - editor

I am trying to show/load different editor on different rows of a editorgridpanel. Like a textbox on one row combobox/superboxselect on another and it could be any order, random.
The conditions which dictate which editor will be shown reside in the database.
Please tell me if this is possible and if so, how do i go about it.. I have tried pulling the conditions asynchronously which are pulled on a click event for the respective column, but calling it async causes problems. Please advise

Anything is possible, but what you want to do would take a bit of work. The basic idea would be to configure the needed grid editor(s) dynamically and update the columns with the new editors when needed. Now... what would be required to make that actually work I couldn't say offhand without digging into the Ext source -- it would almost definitely require overriding default behavior in the grid and/or column model.
Pulling your conditions asynchronously would (I imagine) be too slow for the interaction of clicking on a row to edit inline. If it takes a second or more from click to configured editors, that would not be acceptable performance. I would try to find a way to send your conditions down along with the other row data if at all possible (they can be in the store's data model on the client without having to be shown in the grid).
Without knowing more about your business requirements, it might be more appropriate to ditch the editable grid and instead go with a dynamically-configured FormPanel tied to the grid. This way the interaction of clicking and then pausing slightly while the form is configured would appear to be more natural. Also, the functionality of rendering a form with a particular configuration is perfectly standard and would require nothing fancy on your end. See this example as a starting point (your form would be dynamic, but maybe the same type of interaction could work?)

Related

How to disable textbox dropdown suggestions on certain websites?

I am trying to make my job easier by creating simple AHK scrips to auto-fill certain forms online.
Im not really good at explaining, but hopefully someone will understand what Im saying. The problem is that this website has certain textboxes with dropdown auto-suggestions turned on, and it has a delay when selecting those textboxes. I assume when selecting textbox it is pulling data from some database which is causing delay. Now my question is. Is it possible to turn off dropdown menu on websites or even in entire browser if necessary? I really want to my script to tab-in, wright down whats needed, tab-out without delay.
Autocomplete dropdown lists are just JS scripts. So there is no way, I think, to disable them by clicking checkbox in browser settings.
First, try to disable JS completely.
Also, if only few sites are involved, you could try to find out what JS libraries are used and disable them in browser JS console.
Are you planning to do this via keypresses or via COM?
I imagine that via keypresses you could not avoid focusing the elements and triggering the information lookup.
AutoHotkey can interact with webpages on Internet Explorer using COM (Component Object Model).
COM can launch/latch onto an IE instance, detect if the page is loading/has loaded, navigate to a particular url, and set the text of web elements,
quite possibly without triggering the drop-down lists. I haven't tested if COM can disable elements, it's possible.
Also, Acc.ahk may be able to set the text of elements.

f.select - disabling option based on the first one selected in Rails

I have a form in which user can select two players from a list (two separate select fields). I managed to do it using options_for_select helper, but
user shouldn’t be allowed to select the same player twice - it obviously can't be something like player1 vs player1. I was experimenting with ‘disabled’ option, but without success, because list of available users should change dynamically after selecting first user, which probably can't be done in Rails?
This is a very broad question, with little details, hence my answer will be generic to cover the majority of cases.
You'll have to use JavaScript to hide the same options from the other list. Rails works server-side, therefore you should reload the page if you want Rails to re-render the list without the selected option. But this is a terrible user experience.
However, you should also perform a server-side check. Even if you add the JS in place, it will still be possible to send a crafted request where the players are the same. This is something that must ultimately be verified at server-side level, in your Rails controller or wherever you have the logic to handle the comparison.

Duplicate IDs causing interference between tabs

I am looking at converting a legacy application to use jQuery UI Tabs (using AJAX to acquire the data for each Tab).
We are able to, easily, configure the legacy application to only respond with the HTML "guts" of the page, without the HTML for the surrounding header, left, right and footer panes, and the performance improvement (perceived and actual) is significant, plus it makes the application look a lot slicker and more up-to-date.
However, the legacy application uses 3 separate pages for database CRUD operations:
Page-1 : Criteria form - which posts to:
Page-2 : SQL Query and display Results - with links to:
Page-3 : Form for maintenance of record with DELETE and SAVE options
and there are duplicate IDs, Form Names and FormField Names on all three original pages. Changing the legacy application to make the IDs unique would be a huge amount of work (vast number of such pages), so I would like to work around it if possible.
My first attempt was to "move" the innerHTML from a Tab to an associative array when it loses focus, and reinstate it when the tab gets focus. This works fine from a display perspective, but it seems to break all the Javascript associated with the underlying code (once it has been moved to associative array and back again).
Before I start trying various other approaches I would appreciate any experiences / suggestions you may have. My thoughts are:
A. Sort out whatever is broken by the method I am using
B. Apply a PREFIX to all the Names/IDs when the Tab loses focus, and remove the PREFIX when the tab gets focus.
but maybe there is a better way?
Many thanks for your help.
Other info:
The legacy application has OnClick calls to JS functions [for actions such as SAVE, DELETE, FIND, etc] that assume fixed names for Forms etc. and Validation of the form has JS that defines rules based on names of FormFields ... so changing that across the system would be a lot of work, and require lots of QA testing, hence I am keen to find another route if possible

How can I support user edited content in a complex web application?

I'm building a web site (using ASP.NET, MVC 3, Razor) and I'm not using an off the shelf CMS. This is because I evaluated a lot of existing CMS's, and found them all to have a massive learning curve, tons of features I didn't need, and they force you into a page oriented model. By "page oriented model", I mean that you can specify a general page layout and stylesheets, but the object that the user can edit is a whole page, which displays, for example, in a central panel, and maybe you can customize the sidebars as well.
But this site is very design centric, and needs to be much more fluid and granular than this. By "design-centric", I mean that the site was built in Photoshop by a graphic designer, and there is heavy use of images and complex styling to map the design to HTML/css/js. Also, every page on the site is totally different. There are also UI elements such as accordion panels, in which we need the user to be able to edit the content of each panel, but certainly not the jQuery+HTML that powers the accordion. The users are subject matter experts but very non-technical.
So I'll have a page with lots of complex layout and styling, which I don't want the user to access, but within this there will be, say, a div containing text that I would like the user to be able to edit.
How can I best accomplish this?
So far, I'm implementing this by having snippets, which are little units of html, stored in external files, that the user can edit. In run mode, these are loaded and displayed inline (with a little "Edit This Content" button if you're logged in and have permissions). If you click the Edit button, you get a little WYSIWYG editing screen, where you can edit and save changes. So I can control all the messy stuff, and put in little placeholders for user editable content. But this isn't entirely simple for me, and I'm wondering if there's a better way.
Don't mean to necro this, but it seems to be the most relevant question to what I'm currently researching. I recently built something similar as you described above, but I'm pulling data from a database instead of static files. For each page (like /about or /contact) in the Controller I pull data for that page from the DB in the form of a Json string key/value pair. Key is the placeholder tag, Value is the.. value. After deserializing, I simply populate a list and assign it to a ViewBag, then in the CSHTML I ViewBag.List.Keyname to grab the text.
I have a small admin control panel which allows me to modify the text in the database. Having little hover-overs like you do is a great idea though!
Well, I stuck with my original plan:
So far, I'm implementing this by having snippets, which are little
units of html, stored in external files, that the user can edit. In
run mode, these are loaded and displayed inline (with a little "Edit
This Content" button if you're logged in and have permissions). If you
click the Edit button, you get a little WYSIWYG editing screen, where
you can edit and save changes. So I can control all the messy stuff,
and put in little placeholders for user editable content. But this
isn't entirely simple for me, and I'm wondering if there's a better
way.
It works reasonably well for now.

Importing custom data into Jira issue

I am looking for a simple way to get data displayed in an issue as just plain text. Basically, I want to be able to type in a lookup id in the issue creation and then once the issue is created, it would call one of our web services to retrieve data connected with that ID.
This wouldn't be coming from another issue tracker, but rather straight from one of my databases.
What would be the easiest way of accomplishing this? I would like the workflow to be: Enter id #, hit save, see the data with that ID displayed in the ticket (Doesn't need to be editable, just displayed in the ticket view).
The easiest way is to create a workflow function that is triggered at Create transition to do the job. There your code can query information from the database and replicate them into JIRA standard and custom fields of the issue itself.
Then you can prevent edition of replicated fields by tuning Edit screen for your issues.
You can also use your function to update field content from time to time, either at transition or in a trigger.
An option is to create some read-only custom fields than query each piece information from the database. It will prevent data replication but it will be probably slow and it does not apply to default fields.

Resources