Arrange columns in a proper order
Arrange columns in a proper order
victoreadward
Posts: 7Questions: 0Answers: 0
Hi, how could I arrange columns in a different order than that json brings?
I tried this (order needed):
[code]Name
Instance Dir
Data Dir
Start Time
Uptime
Current
Has Deletions
Last Modified
Max Doc
Num Docs
Optimized
Version[/code]
And in the JS:
[code]'aoColumnDefs': [
{'sName': 'name', 'aTargets': [0]},
{'sName': 'instanceDir', 'aTargets': [1], 'bVisible': false},
{'sName': 'dataDir', 'aTargets': [2], 'bVisible': false},
{'sName': 'startTime', 'aTargets': [3], 'sWidth': '200px'},
{'sName': 'uptime', 'aTargets': [4]},
{'sName': 'index.numDocs', 'aTargets': [5]},
{'sName': 'index.maxDoc', 'aTargets': [6]},
{'sName': 'index.version', 'aTargets': [7]},
{'sName': 'index.optimized', 'aTargets': [8]},
{'sName': 'index.current', 'aTargets': [9]},
{'sName': 'index.hasDeletions', 'aTargets': [10]},
{'sName': 'index.lastModified', 'aTargets': [11], 'sWidth': '200px'}
],
'aoColumns': [
{'mDataProp': 'name'},
{'mDataProp': 'instanceDir'},
{'mDataProp': 'dataDir'},
{'mDataProp': 'startTime'},
{'mDataProp': 'uptime'},
{'mDataProp': 'index.numDocs'},
{'mDataProp': 'index.maxDoc'},
{'mDataProp': 'index.version'},
{'mDataProp': 'index.optimized'},
{'mDataProp': 'index.current'},
{'mDataProp': 'index.hasDeletions'},
{'mDataProp': 'index.lastModified'}
],[/code]
But the column headers stay in order while rows are confused. For instance, Last Modified infor is under Version header, Uptime, Current and Has Deletions information are under, Max Doc, Num Docs and Optimized headers.
What is going on?
I tried this (order needed):
[code]Name
Instance Dir
Data Dir
Start Time
Uptime
Current
Has Deletions
Last Modified
Max Doc
Num Docs
Optimized
Version[/code]
And in the JS:
[code]'aoColumnDefs': [
{'sName': 'name', 'aTargets': [0]},
{'sName': 'instanceDir', 'aTargets': [1], 'bVisible': false},
{'sName': 'dataDir', 'aTargets': [2], 'bVisible': false},
{'sName': 'startTime', 'aTargets': [3], 'sWidth': '200px'},
{'sName': 'uptime', 'aTargets': [4]},
{'sName': 'index.numDocs', 'aTargets': [5]},
{'sName': 'index.maxDoc', 'aTargets': [6]},
{'sName': 'index.version', 'aTargets': [7]},
{'sName': 'index.optimized', 'aTargets': [8]},
{'sName': 'index.current', 'aTargets': [9]},
{'sName': 'index.hasDeletions', 'aTargets': [10]},
{'sName': 'index.lastModified', 'aTargets': [11], 'sWidth': '200px'}
],
'aoColumns': [
{'mDataProp': 'name'},
{'mDataProp': 'instanceDir'},
{'mDataProp': 'dataDir'},
{'mDataProp': 'startTime'},
{'mDataProp': 'uptime'},
{'mDataProp': 'index.numDocs'},
{'mDataProp': 'index.maxDoc'},
{'mDataProp': 'index.version'},
{'mDataProp': 'index.optimized'},
{'mDataProp': 'index.current'},
{'mDataProp': 'index.hasDeletions'},
{'mDataProp': 'index.lastModified'}
],[/code]
But the column headers stay in order while rows are confused. For instance, Last Modified infor is under Version header, Uptime, Current and Has Deletions information are under, Max Doc, Num Docs and Optimized headers.
What is going on?
This discussion has been closed.
Replies
Allan
Beyond that, please link to a test case.
Allan
Thank you.
VE