Flash :: Delete All Rows In A DataGrid?
Dec 28, 2011I need to delete all existing rows from a data grid, i have tried using this but doesn't work[code]...
View 3 RepliesI need to delete all existing rows from a data grid, i have tried using this but doesn't work[code]...
View 3 RepliesI am trying to delete multiple rows in the sqlite table in my Adobe AIR app (runtime 2.5).
Here is the statement, using the "IN" operator:
"DELETE FROM mylist WHERE tdId IN (tdId1, tdId2, tdId3, ...)";
Where tdId1, tdId2, etc. will be determined at runtime based on which row(s) the user chooses to delete. The user can delete arbitrary number of rows.
I've tried something like:
//delete statement text
"DELETE FROM mylist WHERE tdId IN :tdId";
//delete statement parameters: take 1.
[Code].....
It would seem too much of trouble to chain these deletes with a callback. So I guess I am using my last resort: building the sql at runtime. Conclusion: Cached statements can't be used in these kind of situations...
I have this datagrid which has columns with a NumericStepper as an itemEditor where the user can change the number of items he wants to buy. How can I calculate the sum of all cells when the user updates datagrid's values?
EDIT 1
My datagrid is about colors and sizes of a product. The columns are generated dynamically from this function
private function getColumn(dataField:String, headerText:String,editable:Boolean) : DataGridColumn
{
var column:DataGridColumn = new DataGridColumn(dataField);
[Code]....
the row.size28 is generated dynamically. So it could be row.size29,row.size30 etc.
How can I loop through all my cells without knowing their data.property?
I have a datagrid and it lists several rows as
seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jenny | M&Y
3 | Jane | D&T
It is possible to have buttons as [MOVE UP] and [MOVE DOWN] so that when I select a row in a datagrid and press one of those button that the order changes and the seqno updates accordingly.
Meaning if I select Jane and press the [MOVE UP] button, the new order would be;
seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jane | D&T
3 | Jenny | M&Y
I have a data grid consisting of 3 columns & many rows, i want to show only the first 20 rows to user. Is there any way i can show only the first 20 rows in my datagrid.After by clicking button 'next', next 20 rows should display and so on...
View 1 RepliesI am creating an app where users input their investment info into a datagrid on each row one row at a time. As they move along new rows are dynamically generated so they can input new investments. As the user moves and puts in new info I want a column to display what row the user is on (or better said what number investment he is on). how to create the function:
private function rowCount():void
{
myDG.dataProvider=tasks;
[Code]....
which is great because it shows how to add columns to a datagrid, but how do you add and remove rows to the datagrid?I'm trying to I'm trying to come up with a Character Generator for our Tabletop Wargame (see hereand rows to appear when you say click on a Weapon like Fist and then onto another weapon (Fist only works atm as a demo).ie how could i format it so it was like a table (because at the moment the Fist stats are formatted with spacebar spaces), and how could i make it so that when you choose your 1st weapon it appears 1st in the table (say a Bow), and when you click your 2nd weapon it appears 2nd in the table (say a Sword), etc...
View 8 RepliesI have a 1 row, many column flex datagrid. I would like to turn the dataGrid on its side, so that the column headers become a single column running down and v.v. Is there a way to do that in the DataGrid? Or am I stuck manipulating the data presented to the grid?
I have an object like:
x=y
b=u
o=p
u=e
w=p
And I'd like a control that is visually similar to that. Currently the datagrid displays the object as:
x b o u w
y u p e p
Which is too horizontal for my case.
I have an array like the following one
public var sal:Array=[
{empNo:1001, sal:1000, exp:400},
{empNo:1002, sal:3000, exp:240},
{empNo:1003, sal:1000, exp:452},
{empNo:1004, sal:5000, exp:348},
......
{empNo:1550, sal:2000, exp:330},
];
I need to show data using a 3 row flex data grid where the first row will display empNo, the second row will display corresponding salary(field sal), and the third row will display Expenditure (field exp).
I am trying to extend the DataGrid to allow headers for different groups of rows. However, I cannot figure out which method to extend from DataGrid that would allow me to accomplish this. I do not want the headers to be included in the dataProvider, only the rows. I want to specify indexes to insert the headers at using a property of the custom datagrid.
Here is a quick photoshop showing what I am trying to do:
Is there any custom component already built that will do this?
I have a table (session) in a database which has almost 72,000 rows. I extract those rows with the help php+mysql but when the result is returned to the HTTPService, i need to wait for some 32 seconds before the all the rows start appearing in the DataGrid at once.
Question Is there any way by which DataGrid may start displaying data one by one while the application may extract next rows in parallel. Or that the DataGrid may show data in chunks of hundreds. Like when application starts, it may show first 400 enteries in DataGrid, then the next 400 hundred are extracted until all the 72,000 rows are extracted? Or can i involve threading such that one thread may be responsible for displaying data in datagrid while the other, executing in parallel may be responsible for extracting next data from database?
[Code]....
Is it possible to dynamically show row index for DataGrid rows ?
I have a static ArrayCollection which is set to be DataGrid's data provider and I would like to always have row numbering for each populated row (e.g. in a column called "#").
My problem is that empy rows (if there are more rows that dataSource items then there are empy rows) look identical to rows binded to dataSource items which are empy (see the difference?). The only way to know the difference is to hover over them with the mouse, and if they are empty there's no color change, otherwise there's the blue background of the selection.. I want to change the color or in some way hide empty rows, those that are not bound to a dataSource item.
View 2 RepliesI am using the following itemrenderer in one of the column of my datagrid. However I want to format each row of the datagrid differently. The column consists of numbers but some need to be formatted as Numbers while others as currency etc. Also note that I have an additional column which consists of 0 and 1 where 0 means that it should be formatted as Number and 1 means that it should be formatted as Currency.
<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
how I can implement such a function, am trying to use dataGridListData.label in a function in the itemrenderer but it gives error.
Is there a way in spark datagrid to disable some rows programmatically, in flex 3, it could be done using the function mouseEventToItemRenderer this way:
override protected function mouseEventToItemRenderer (
event: MouseEvent): IListItemRenderer {
var listItem: IListItemRenderer;// = super.mouseEventToItemRenderer(event);
[Code]....
And then I implement the function disabledRow to return true or false depending on some condition, the condition that will specify if the selected item will be renderered or not. Is there a way in spark datagrid to do the same?
I have an AdvanceDataGrid. How can I show the total of each column at the bottom. I am able to calculate the total, and tried displaying them on labels below each column by giving width as column width. But they are not getting aligned properly below each column.[code]Is there a way by which I can assign total to the grid itself instead of using seperate labels below.
View 1 RepliesI've got a reporting system that uses Flex Visualization charts for the GUI. The first row of a report is the header and the second is a summary row that sums all the data in that column for the data rows. The summary row is locked so that when you scroll down it stays at the top. In Flex 2.X I was able to change the background color of this locked summary row by overriding drawRowBackground and setting the color for the row with index 0. I upgraded to Flex 3.4 and now this no longer works. It appears to iterate over lockedRows separate from other rows, so drawRowBackground is called with a row index of 0 twice and the first data row ends up getting colored.
How are you supposed to change the background color of lockedRows in 3.4, or am I misusing this component and there is another way to achieve my goal here?
edit: mods I think maybe I misunderstood the name of this forum and this post actually belongs under ActionScript 3.
I have an ADG along with some other components in a VBox. The number of rows of items in the ADG is variable. I want the height of the ADG to be however tall it needs to be to show all the rows without scrolling. This is because I want the containing VBox to handle all the scrolling. The reason being, is because sometimes there is a horizontal scroll bar on the VBox, in this case you have to scroll all the way to the right to reveal the scroll bar for the ADG before you can scroll the ADG.
View 1 RepliesI have a DataGrid populated via an Array. The last column in the DataGrid uses an ItemRenderer (Button). I want to show the Button in certain rows but not in others (leave those empty). I've looked everywhere for an example or even a clue how to do this (tried labelFunction on DG, etc.) but can't find anything about it.
View 3 RepliesI have a flex datagrid with 3 columns. The first column contains the image name(unique key). The other two columns have username and size details. I want to split the username into lastname, firstname, address and some other stuff. Can we have multiple rows in the grid for one image? Tried multi-line, it works but we need to keep adding spaces and its cumbersome. Since each row in the flex datagrid is represented by one index in the XMLList which is enumerated, is there a way to have more than one row assigned to one image and shown in the grid? something like this.
View 1 Replieshow I can select a row in a datagrid in flex and have it highlight that row plus any related rows.Let me give you can example:Let's say that I have a datagrid. In the grid I have two columns for each row. One column has what type of car they own, and the other column has the owners name. Let's say that an owner has two cars. So you have a datagrid that looks like this (4 rows, 2 columns):if you click on the Camery row, the Jaguar row and the Camery row are both highlighted.I have a datagrid that has items, and has related items to its parent.
View 2 RepliesIs it possible to have "Move-Up / Move-Down" buttons that can move a selected row in a dataGrid and move it to a different row in the database?
Where can I get more info or an example of this and what would this type of operation be called?
I added a checkbox in a DataGrid using ItemRenderer. I have pasted the code I am using below.
<mx:DataGrid id="dgEmployeeInfo" dataProvider="{resultArray}" x="131" y="95" editable="false">
[Code]...
I need to allow drag and drop in my DataGrid, but I have a lot of item renderer and item editor that makes conflicts with events when dragging.
So, I want to restrict the activation of drag and drop in the first column ?
I have a DataGrid which uses an itemRenderer to display the items in a DataGridColumn. The ItemRenderer is created in actionscript and contains the following code:
public class PromptingColumnRenderer extends Label {
public function PromptingColumnRenderer()
{
[Code].....
In this DataGrid column, I require number validation on only the data with the type="NUMBER" field set. The problem is, when I try to declare a NumberValidator within my PromptingColumnRenderer actionscript code, the view recycles the renderer, and the NumberValidator attempts to validate non-numeric rows. What is the best way to validate only the rows with the type="NUMBER" field set?
I am populating 3 columns of my datagrid using a simple XML file. The last column is supposed to be an itemrenderer, basically a Button. However the button should appear only on certain rows of the 3rd column of the datagrid depending on the value from the XML file, which is either "true" or "false". So basically I want to set the Visible property of the button in the itemrenderer to true or false.
[Code]...
i am creating a popup of a textarea though which i am storing my notes in a data grid. The Code for the data grid is given below.
Now when i add the note IT fits in one of the rows. Now all the rows have same size. I want to make the size variable so that the text fits in each row. For big text notes the height of rows should be greater so that no scroll needed. similarly when the data is small then the height should be small
<mx:AdvancedDataGrid x="0" y="231" width="872" height="273" fontSize="12" id="dgRecentNotes" horizontalGridLineColor="#01030B" dataProvider="{patientProfile.notes}" horizontalGridLines="true" variableRowHeight="true">
[Code].....
I'm looking for a DataGrid with expandable rows implementation in Flex. I don't want to use Advanced DataGrid control because it's too slow and too complex.The desired behavior is like this: when you click a row, a panel opens between the rows with some details and the rest of the rows are moved down, and when you click again the panel is closed and the rows are back to normal. If you click the other row, the one that was expanded collapses and the row you clicked is expanded.
View 3 RepliesDoes anybody know how to add a new row to a datagrid via a checkbox.
example:
checkbox 1 : label (PS2)
checkbox 2 : label (PS3)
checkbox 3 : label (PSP)
By selecting one or all of these checkboxes i what to add a new Datagrid row.
Datagrid
Console price
row1 PS2 $20,
row2 PS3 $30,
row3 PSP $15,
Is there a way to insert a horizontal line after a certain number of rows, which may be variable depending upon a property in data provider of a datagrid?
View 2 Replies