在表组件中创建动态列 [英] Create a dynamic Columns in table components

查看:82
本文介绍了在表组件中创建动态列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



i有一个包含n列的表组件,但我需要按顺序显示列或作为参数传递的位置。



例如,如果我有2列(Id,name)我需要为id id传递参数2以在名称后面显示它,结果是(name,id)



有人可以帮我吗?!

Hello,

i have a table components with n number of columns , but i need to display the columns in order or position passed as a parameters.

for example if i have 2 columns(Id,name) i need to pass a parameter 2 for id id to display it after the name so the result is (name,id)

anyone can help me please??!

推荐答案

我假设你把参数放进去服务器端生成的< table>元素。



当您从查询返回中读取每一行数据时,直接将其映射到数组元素:

例如,如果你有行元素A,B和C,你希望按照B,C,A的顺序输出它们,然后执行以下操作:



如果你的排序order在数组中
I assume you're putting the parameters into a server-side generated <table> element.

As you read each row of data from your query return, map it to an array element directly:
For example, if your have row element A, B, and C, and you wish to output them in the order B, C, A, then do the following:

if your sort order is in the array


order =(2,3,1);

order = (2,3,1);


row = Get_The_Row_From_SQL_Return();

for(
row = Get_The_Row_From_SQL_Return(); for(


这篇关于在表组件中创建动态列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆