我有這樣的陣列結構設置的:如何通過鋼結構製品的陣列循環中的ColdFusion
<cfset table_columns = [
{name="Right Name", var_name="right_name", searchable="true", sortable="true"},
{name="Right Type", var_name="right_type", searchable="true", sortable="true"},
{name="Right Description", var_name="right_descr", searchable="true", sortable="true"},
{name="Edit", var_name = "editcol", searchable="false", sortable="false"}
]>
我怎麼會遍歷呢?這裏是什麼,我需要做榜樣(這顯然是不工作):
<cfloop array="#table_columns#" index="data_index">
{"sName": "#table_columns[data_index]['name']#", "sTitle": "#table_columns[data_index]['var_name']#", "bsearchable": "#table_columns[data_index]['searchable']#", "bsortable": "#table_columns[data_index]['sortable']#"},
</cfloop>
這就是我一直在尋找,謝謝! – RandyLahey 2012-02-08 18:40:18
我收到錯誤:元素'mykey'在作爲表達式的一部分引用的CFML結構中未定義。 – 2013-10-04 06:10:23
@yoosafinpace - 對於新的問題,你應該[打開一個單獨的線程](http://stackoverflow.com/questions/ask)。一定要包括1)一個獨立的例子和b)任何錯誤消息。 – Leigh 2013-10-05 04:20:57