Hello,

I have written a custom module add ajax pagination for it but my problem is that under every other themes works like a charm, but with bootstrap the ajax content open in new window (jquery not included?)

Here are some codes:

/// AJAX Callbak for reservations
    $items['crm/reservations/callback'] = array( // Create CRM entris list callback
    'title' => 'Reservations Ajax Pager Callback',
    'type' => MENU_CALLBACK,
    'page callback' => 'apartment_crm_core_reservations_ajax_pager_callback', //this is the function that will be called when the page is accessed.  for a form, use drupal_get_form
    //'delivery callback' => 'apartment_crm_core_reservations_ajax_pager_callback', //this is the function that will be called when the page is accessed.  for a form, use drupal_get_form
    'delivery callback' => 'ajax_deliver',
    'access arguments' => array('access apartment_core_crm'),
    'file' => 'reservations_list_form.inc', // Source file of the implementations
);

The form where I use this:

/**
 * Apartment CRM Core customers table with form filtering
 */ 
function apartment_crm_core_reservations($form, &$form_state){
 
  $form = array();
  $header = array();
  $rows = array();
	
	$form['calendar'] = array(
		'#type'  => 'fieldset',
    '#title' => t('Calendar'),
	);
	
	$form['calendar']['calendar'] = array(
		'#prefix' => '<div id="calendar">',
		'#suffix' => '</div>'
		/*
		'#attached' => array(
      'library' => array(
        array('apartment_crm_core', 'fullcalendar'),
      ),
		),
		*/
  ); 
	
	$form['filters'] = array(
		'#type'  => 'fieldset',
    '#title' => t('Search customers'),
  ); 
	
	$form['filters']['search_text'] = array(
		'#type'  => 'textfield',
    '#title' => t('Searh') . ': ',
		'#required' => FALSE,
		'#tree' => TRUE,
    '#description' => t("Please enter text to find."),
    '#size'  => 40,
		'#ajax' => array(
			'callback' => 'ajax_reservations_search_callback',
			'wrapper' => 'results',
			'event' => 'change'
    ),
  ); 
		
  $form['results'] = array(
		'#prefix' => '<div id="results">',
		'#suffix' => '</div>'
  ); 
	
	// Create customers table here
	$table = create_reservations_table($form, &$form_state);
	$header = $table['header'];
	$rows = $table['rows'];

	
  // Format output.
  $form['results']['table'] = array(
    '#theme' => 'table',
    '#header' => $header,
		'#rows' => $rows,
		'#attributes' => array('id' => array('crm-reservations-table'),'class' => array('footable')),
		'#empty' =>t('Customers table is empty...'),
  );

	$form['#attached']['js'] = array(
		'data' => drupal_add_js(drupal_get_path('module', 'apartment_crm_core') . '/js/jquery.url.js'),
		'type' => 'external',
	);
	
	$form['#attached']['js'] = array(
		'data' => drupal_add_js(drupal_get_path('module', 'apartment_crm_core') . '/js/apartment_crm_core_reservations_ajax_table.js'),
		'type' => 'external',
	);
	
	$form['#attached']['js'] = array(
		'data' => drupal_add_js('initializeTable();', 'inline'),
		'type' => 'inline',
	);
	
  $form['results']['pager'] = array(
		'#theme' => 'pager',
  );
  
  return $form;
}

/**
 * AJAX callback handler for the status select for form filtered list.
 */
function ajax_reservations_search_callback($form, &$form_state) {
  //$form_state['rebuild'] = TRUE;
	
  return $form['results'];
}

The ajax pager callback function:

/**
 * AJAX Pager Callback for customers table:
 */
function apartment_crm_core_reservations_ajax_pager_callback(){ 
  
  //$form_state['filters']['status'] = $form_state['values']['status'];
  //dpm($form_state['values']['status']);
  
  header("Content-type: text/html");
  header("Expires: Wed, 29 Jan 1975 04:15:00 GMT");
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  header("Cache-Control: no-cache, must-revalidate"); 
  header("Pragma: no-cache");
    
  //Theme the html table: http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_table/7
  $table = create_reservations_table();	
  $header = $table['header'];
  $rows = $table['rows'];
	
  $html = theme('table', array(
  'header' => $header,
  'rows'=>$rows,
  //'sticky' => TRUE, //Optional to indicate whether the table headers should be sticky
  'empty' => t('No reservation was created...'),		//Optional empty text for the table if resultset is empty
  'attributes' => array('id' => array('crm-reservations-table'),'class' => array('footable')),
 )
);
	  
  //Append pager: http://api.drupal.org/api/drupal/includes--pager.inc/function/theme_pager
  $html .= theme('pager', array(
			'tags' => array()
		)
  );  
  
  die ($html);
  
}

Comments

Prancz_Adam created an issue. See original summary.

markhalliwell’s picture

Status: Active » Closed (won't fix)

under every other themes works like a charm

That does not automatically make it an issue with this project.

Aside from the bootswatch theme links on the settings page, which is unrelated, there is no other target="_blank" attributes set on links anywhere in the theme. Nor is there any window.open() calls in any of the JS implemented.

Simply put: it is technically impossible for this project to be the culprit.

You obviously have an issue with some other project's code or even your own custom code somewhere else. Also, this issue queue is not a support forum.

Closing per http://drupal-bootstrap.org/api/bootstrap/docs%21contribute%21README.md/...

Reason: general support question, site specific

markhalliwell’s picture

Status: Closed (won't fix) » Closed (works as designed)

Actually, this is a more appropriate status.

Prancz_Adam’s picture

Ok thanks and sorry for inconveniences.