We're redesigning a huge application at work and I'm tasked with figuring out whether the Infragistics grid is the appropriate tool for much of the data entry.
Our current data entry screens are nibs, and there are tons of them.
We're looking to replace all these nibs with a more generic, simple, reusable type of layout.
Per the image...
(A) The field labels would be presented in the first column in the 2-column grid. This you would just create in code, or perhaps read from an XML file.
(B) This would be an array of values pulled from Core Data (which pulled them from Sqlite). These need to go into the second column.
(C) The rows in the grid cannot be in any ol random order. For example, the user is going to be irritated if they open the app the second time and see the rows listed as ...
Current understanding / needs:
1. I think sorting will be required here in order to enforce the order of the entry fields as shown in the first column of the grid, but that will mean attaching additional data to (A) that will allow the sorting to occur, but if I did have two data items in (A), a numeric sort order value, and a corresponding label value, I don't know how I'd get the labels into the grid, while sorting with the numbers.
2. The grid only has 1 property for it's data. There isn't for example, a datasource for the labels column, and a datasource for the values column. So I'm not sure how to set up the grid for this sort of data entry.
3. The values in column 2 of the grid need to be aligned with their corresponding labels in column 1. The user will be quite confused if they see "First Name" --> 98119. I don't know how to achieve that either.
Thanks for any help.
Hi,
Of course. Our editing is just there for quick standard use cases. You can customize the cell however you'd like, and attach your own gestures to enter editing mode.
Just create a custom column and return your new cell from it, like in that other sample i sent you on the other thread.
-SteveZ
Ok, that's good to know, but say I want to take it to an extreme and use a textbox where the background changes color when the cell is edited, and maybe some other features. Can I do as I suggested... inherit from the base grid cell and do a total customization?
Hi David,
If you just want a textbox, you can use the built in editing of the grid. Just change your code like so:
_dsh.autoGenerateColumns = NO;
_dsh.allowEditing = YES;
IGGridViewColumnDefinition* col = [[IGGridViewColumnDefinition alloc]initWithKey:@"fieldLabel"];
col.editable = NO;
[_dsh.columnDefinitions addObject:col];
[_dsh.columnDefinitions addObject:[[IGGridViewColumnDefinition alloc]initWithKey:@"value"]];
Now when you double tap a cell, it will go into edit mode and display a textbox.
Hi Steve,
I finally got a look at this and it works great for displaying data, but I'll need to be able to edit data.
Could I make a custom cell that contains a Label for the field name, and a textbox to do the data entry, and then inherit from your base grid cell or something like that?
Wow you're fast.
Thanks a lot.
In the meantime I had started playing with a trial version of Indigo, and I can't put it down. It's really cool, so I'll take a look at your code sample this weekend, and come back to update this post.