Page 1 of 1

Datagrid Error: column template

Posted: Fri May 13, 2011 9:45 am
by Linh
Hi guys,

I use a table datagrid. Yesterday, everything is still OK, but today I open the card again, and there is a error has occurred:


"An error has occurred in behavior for the column template:
Chunk: error in object expression"
"Edit Script" or "OK"


I click "Edit Script" and LiveCode open code of button "Data Grid" of group "Behaviors" of card "card id 1002" of stack "..." (I think it's template card of datagrid). This line is highlighted: "if pIndexesToDraw is not empty then"

I haven't modified anything in this card. I don't know how to fix this problem :(. Have you ever seen this error and how to fix it? Thanks so much!!!!

Linh

Re: Datagrid Error: column template

Posted: Fri May 13, 2011 12:27 pm
by Klaus
Hi Linh,

I have not encountered this error, but something else and similar to this.
It was also an error from the datagrid library (which I did not touch!) and
I "fixed" it by restarting LiveCode. :D

I am afraid you cannot do very much about it!
If you can reproduce this error then you could bug-report it to: bugs@runrev.com


Best

Klaus

Re: Datagrid Error: column template

Posted: Sat May 14, 2011 8:05 am
by Linh
Thank Klaus (again :D, you always help me - and other guys - when we post any question, and your answers are very useful 8) )! I try to restart, but the bug still appear. So I delete the old datagrid and create a new one. The problem is the default sort by column :D. LiveCode has bug when sort one column of mine (I don't know why, the other sort column is still OK). Maybe it's a bug of LiveCode.

Cheers,
Linh

Re: Datagrid Error: column template

Posted: Sat May 14, 2011 11:40 am
by Klaus
Hi Linh,

what exactly does not work?
I have been sorting datagrids and never had problems.

Best

Klaus

Re: Datagrid Error: column template

Posted: Sat May 14, 2011 1:25 pm
by Linh
Hi Klaus,

I put this in openCard:

set the dgProp["sort by column"] of group "dtgContractList" of card "contract_list_card" of stack "ListStack" to "product_title"
set the dgColumnSortDirection["product_title"] of group "dtgContractList" of card "contract_list_card" of stack "ListStack" to "ascending"


If I set in openCard: sort by column "product_title", the error occurred. Sort by other columns is still OK.

Re: Datagrid Error: column template

Posted: Mon May 16, 2011 5:55 am
by Linh
Hi Klaus,

I understand why I can't sort by that column at the openCard. Because the text of one line in that column have enter (CR), so LiveCode can't sort by that column :D