5

hello all actually I'm developing a component for school in which i want to add a batch button for asking about fail & leave fail & reappear pass & promote, pass & leave and for this i want to add a batch button...

I'm not so expertise in joomla development can anyone help me how to add a batch button i also try to copy batch code from articles view but not working. so i consider to learn it. HELP ME PLEASE

7

Add this to your view.html.php to add the button to the toolbar:

// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');

JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');

// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');

$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');

and put this into your default.php:

<div class="modal hide fade" id="collapseModal">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&#215;</button>
        <h3>My modal window</h3>
    </div>
    <div class="modal-body modal-batch">

    </div>
    <div class="modal-footer">

    </div>
</div>

to display an empty modal window with the heading "My modal window" when you click on the batch button.

You can see how the modal window for the articles view is build at /administrator/components/com_content/views/articles/tmpl/default_batch.php (but you probably know that already)

  • thanks Mr. fruppel this will help and save my lots of time – Sumer Raj Chouhan Apr 17 '15 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.