Just in case anybody else runs into this problem, here is my solution. 
 Since the native remove and add flags do not work, you need to write you 
own functions for them.  Each function should save the state of the table 
in their own data structure, perform the action on their data structure, 
and then clear the table and repopulate it with your data structure.

thanks,

James

On Monday, June 23, 2014 4:30:58 PM UTC-7, James Sathre wrote:
>
> Hello,
>
> I'm trying to figure out how the scriptTable works, and I'm a little 
> confused with the output.  Why is it that when you delete the first row, 
> the table no longer has the correct items in it?  The last row seems to 
> disappear?  Is there a good resource online that describes the proper 
> function calls?
>
>
> import maya.cmds as cmds
>
> def edit_cell(row, column, value):
>     return 1
>
> window = cmds.window(widthHeight=(400, 300))
> form = cmds.formLayout()
> table = cmds.scriptTable(rows=2, columns=3, label=[(1,"Column 1")], 
> width=420, height=400, cellChangedCmd=edit_cell, excludingHeaders=True)
> cmds.scriptTable(table, cellIndex=(1,1), edit=True, cellValue="1")
> cmds.scriptTable(table, cellIndex=(2,1), edit=True, cellValue="2")
> cmds.scriptTable(table, edit=True, deleteRow=1)
> cmds.showWindow( window )
>
>
>
> This code should show a line with '2' in it, but the table is blank in all 
> columns?
>
> thanks,
>
> James
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/8a7048fc-6c2e-42b1-9801-9755877f0ba9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to