How to show sort icon when datagrid loads - gwt

I want to show sort icon on one column when datagrid loads but it displays after
user clicks on one of the column. Is there any way to do that.
Thanks,

I have to guess since you show no code, but it's possible you never told your Datagrid which column to use for sorting upon loading data. You should call
myDataGrid.getColumnSortList().push(myColumn);

Related

SAP UI5 : MultiCombobox selected values should appear in vertical fashion

For my multicombobox, I need all the selected values to appear vertically rather than horizontally as it is hard to see all the selected values at once if there are more than 3-4 selections.
With one of the latest releases of UI5, a "n-more" feature was introduced in the MultiComboBox. It could be seen here. Add several items from the MCB and focus out.
I guess that this should be fine for you to see the selection no matter how much items you have at all. On the mobile view you can toggle the button next to the input field in the dialog in order to see all selected items.

Tab control to autoenter field contents

I have a set of tabs inside the window items layout in the database file.
when I click the plus popover button, I want it to generate a new record in the products layout and fill out all the fields based on the active tabs and the extra description field based on the last edit box field at the bottom of the tabs. can someone help me do this as I have tried a few different scripts and have had no success. once the record has been created in the products layout/table, I also want it to generate a record in the window item table based on the linked itemid field and the autoenter calculation that is setup on the description field.
this is probably all very confusing but I would be glad of any help you can offer.
Window Item Database Copy
Your question is more a problem than a question.
I'm assuming your questions:
1) should I use a script trigger for that?
Probably not. You should use a button to call the script, it should create all the records you need, come back to the layout and open the popover.
2) how to check the active tabs?
You should you the getLayoutObjectAttribute ( , "isFrontPanel" ). That will allow you to correctly set the ifs.
3) how to create a record in any table?
to be honest, you should start by going to the layout you want and then creating the record. That's an easier way.
What you are trying to accomplish is not that hard. You just need to break it in smaller steps.

jquery hide show

I have a table generated from database ( basically in MVC view). I want to make it editable. I want to use jquery to hide the row when edit button infront of row is clicked and show the row in edit format which is by default hidden. how can I do this using jquery?
Please suggest solution
Thanks
I was able to accomplish this by tagging the table row with a fake class name, then in the button click events I used jquery's Hide/Show. Like this:
In your edit button click event call this:
$('.trMyRowIWantToHide').hide();
And tag your table row with a fake class like this:
<tr class="trMyRowIWantToHide">
JQuery Show
http://api.jquery.com/show/
JQuery Hide
http://api.jquery.com/hide/
You also may want to make use of div tables for this project instead of actual tables. You selectors such as $("#idofcolumn").toggle(); to hide and show the div or in your case you would probably want to show a text field. You could even .html() to replace the text in a column with a text box. There are several ways to go about this. Check out the JQuery documentation.
http://docs.jquery.com/Main_Page
How exactly is the HTML set up for your rows? Normally you could do $('SELECTOR').toggle() on each of them.

how to add a disclosure panel to a cellTable column in GWT

I have a cellTable with 5-6 columns. I want to put a plus icon in each row on clicking of which will display the details maybe in a disclosure panel. I have been looking around for a while now and I cannot find any information on how to achieve this. Could someone point me in the right direction?
i suspect i probably have to add a cellTree to the column? how do i go about this?
Thank you for your response in advance.
There is work in progress to allow expandable rows in CellTable among other features (maybe GWT 2.3). You can see more details here:
http://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/b4a8a6e3c98ac061#
If that is not enough or you can not wait untill it is released I can think of two ways to achieve it:
As you said, using a CellTree.
Creating a custom cell that stores
state (open/close). Depending on the
state the cell will render
differently. In same way it is
similar to how EditTextCell works, in
"edit" state it renders an input
field while in "normal" state it renders
simple text.
I'm trying to do that too ... I managed to mimic that functionality toying with the html and a custom cell class that allows clickable pictures.
It is working for normal content such as text but if you'd like to get an asynchronous data to show in the expended line, I don't know how to do it ... (I'm trying to do exactly that).
Also, it doesn't look good because the columns don't align well ...
So what I've done is:
- create a custom cell class to display a picture (right pointing triangle, looking like the triangle in the disclosure panel)
In the click event get the HTML code of the selected row and copy it. Replace the content of the row (all cells) in the table with only one cell with its colspan set to number of columns. In the cell, add a table with first line the copied row and second line the content to display as expanded.
Get the image to sink an event for closing. In event, reset the original row that we copied.
I hope it helps.

GWT-Ext EditorGridPanel rendering problem

I am using GWT 1.6.4 and GWT-Ext 2.0.6. I am trying to use EditorGridPanel and facing rendering problems.
When the module loads I create a Panel (TopPanel) with BorderLayout and add that to the ViewPort. I then create another Panel (CenterPanel) and add EditorGridPanel, three buttons to the center of the BorderLayout Panel (TopPanel). I tried many layouts for CenterPanel but still not able to get what I want.
I want the table to showup with the required data and scrollbars. All the three buttons comes below the table. The data for the table come via Async call when the module loads, so when the screen is rendered to the user, the data is populated in the table. But looks like the table gets rendered with no data and when the async process finishes the table gets populated but don’t get resized to fit the screen so only show me one row.
The problem is with the Grid, I am not getting any scrollbars. Secondly I don’t want to define the height and width of the Grid. I want it to take as much as possible and show scrollbars, just like we do in html table by setting width and height as 100%.
Thanks
I have found the solution. I had to add the Grid on a panel. I had to set the layout of that panel to FitLayout(). Secondly had to call doLayout() on that panel after loading the Store with the data. I now get the scrollbars for the table as well as it fits the whole available space.