'@todo: docstring?'

def _create_import_item_dataTable(self, upload_id, job_id):

    s3 = current.response.s3
    represent = {'s3_import_item.element': self._item_element_represent}
    self._use_import_item_table(job_id)
    table = self.table
    query = ((table.job_id == job_id) & (table.tablename == self.controller_tablename))
    rows = current.db(query).select(table.id, table.error)
    select_list = []
    error_list = []
    for row in rows:
        if row.error:
            error_list.append(str(row.id))
        else:
            select_list.append(('%s' % row.id))
    s3.filter = query
    if self.ajax:
        resource = self.resource
        resource.add_filter(query)
        rows = resource.select(['id', 'element', 'error'], limit=None)['rows']
        return (upload_id, select_list, rows)
    s3.actions = [dict(label=str(self.messages.item_show_details), _class='action-btn', _jqclick="$('.importItem.'+id).toggle();")]
    output = self._dataTable(['id', 'element', 'error'], sort_by=[[1, 'asc']], represent=represent, ajax_item_id=upload_id, dt_bulk_select=select_list)
    self._use_controller_table()
    if (self.request.representation == 'aadata'):
        return output
    s3.dataTableStyleWarning = error_list
    form = output['items']
    job = INPUT(_type='hidden', _id='importUploadID', _name='job', _value=('%s' % upload_id))
    form.append(job)
    return output
