Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7939585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:08:46+00:00 2026-06-03T23:08:46+00:00

BA.Table.prototype.drawHeader = function() { if ( ! this.headHTML ) { this.headHTML = $(‘<thead/>’); var

  • 0
BA.Table.prototype.drawHeader = function()
{
    if ( ! this.headHTML ) {
        this.headHTML = $('<thead/>');
        var tr = $('<tr/>');

        var didSort = false;

        if ( ! this.config.noIndex ) {
            var th = $('<th class="table_index"></th>');
            th.appendTo(tr);
        }

        for( var ix = 0; ix < this.children.length; ix++ ) {
            var child = this.children[ix];
            if ( child instanceof BA.InputHidden
                 || ( child.config && child.config.hidden ) )
            {
                continue;
            }
            if ( ! child.config.id ) {
                child.config.id = 'c' + ix;
            }
            var label = child.config.label ? child.config.label : '';

            var labelHTML;
            if ( child.config.title ) {
                labelHTML = $('<th><span title="' + child.config.title + '">' + label + '</span></th>');
            } else if ( child.config.sort ) {
                var a = $('<a href="#" id="sort_' + child.config.id + '">' + label + '</a>');
                a.bind('click', {t: this, i: ix}, function(event) { event.data.t.sortByColumn(event.data.i); return false; });
                if ( child.config.sorted ) {
                    var img = child.config.sorted > 0 ? 'up' : 'down';
                    $('<img src="' + window.IMAGES_PATH + img + '.gif"/>').appendTo(a);
                }
                labelHTML = $('<th/>');
                a.appendTo(labelHTML);
            } else {
                labelHTML = $('<th>' + label + '</th>');
            }

            labelHTML.appendTo(tr);
            child.hideLabel = true;
        }

        if ( this.config.canAddRows === undefined || this.config.canAddRows == true
             || this.config.canDeleteRows
        ) {
            var labelHTML = $('<th class="action"> </th>');
            $(labelHTML).appendTo(tr);
        }
        tr.appendTo(this.headHTML);
        this.headHTML.appendTo(this.tableHTML);
    }
}; <br>

The above is common library for creating table. Using json object to draw the table
The below is php page

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<script type="text/javascript">
var listLayout = {
    o: 'Page',
 c: [
        { o: 'Form', id: 'list', name: 'list', c: [
            { o: 'Table', canAddRows: false, value: [],
                caption: { c: [
                  { o: 'Button', label: '<?php echo lang("add_new_volume");?>', id: 'vr_add_icon' }
              ]},
              c: [             
                { o: 'HTML', label: '<?php echo lang('volumes');?>', id: 'volumes_', 'class': 'name' },
                { o: 'HTML', label: '<?php echo lang('type');?>', id: 'type_', 'class': 'type' },
                { o: 'HTML', label: '<?php echo lang('drives');?>', id: 'drives_', 'class': 'driver' },
                { o: 'HTML', label: '<?php echo lang('usage');?>', id: 'usage_', 'class': 'usage' },
                { o: 'HTML', label: '<?php echo lang('size');?>', id: 'size_', 'class': 'size' },
                { o: 'HTML', label: '<?php echo lang('status');?>', id: 'status_', 'class': 'status' },
                { o: 'HTML', label: '<?php echo lang('operations');?>', id: 'action_' }
            ]},
            {
                o: 'HTML',
                html: '<div class="mv_ajax_status"></div>'
            }
        ]}
    ]

enter image description here

in the above image first colum heading is missing.. with out editing library how can i added Sr.no for first column. i need first colum heading name is Sr.no. but with out added anything to main library..

if ( ! this.config.noIndex ) {
            var th = $('<th class="table_index"></th>');
            th.appendTo(tr);
        }

if i added above var th = $('<th class="table_index">Sr.no</th>'); it come..but without adding theer how can i get first colum heading. ?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:08:48+00:00Added an answer on June 3, 2026 at 11:08 pm

    try :

    $('th:first').text('Sr.no');
    

    Uses the :first selector to select the first th

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var down=function(a,b){alert(a)} Array.prototype.sort.call(table.tBodies[0].childNodes,down) Array.prototype.sort.call([0,1,2,3],down) Why do I not get alerts from the first sort
QTableWidget::setItemPrototype says following. The table widget will use the item prototype clone function when
I'm trying to construct a table with Prototype's New Element function. I was experiencing
I like to create an object myself like so: function Table() { }; Table.prototype.toString
I am getting this warning from storyboard - prototype table cells must have reuse
$(#table_exams tbody tr).click(function (event) { window.location.href=# +$(this).attr(exam_ID); window.location.href=/medilab/prototypes/exams/edit?examId= + $(this).attr(exam_ID) +&referer= + referer; row_select(this);
Here is my spaggeti code $(#table_exams tbody tr).click(function () { window.location.hash=# +$(this).attr(exam_ID); window.location.href=/medilab/prototypes/exams/edit?examId= +
I have a table of play data that I'm using for a prototype. I'm
I'm trying to build a prototype application that consists of a table of data
I have a function to display the values of a vector in a table,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.