You are here

README.txt in Elements 5

Same filename and directory in other branches
  1. 6 README.txt
  2. 7 README.txt
Description
===========
Elements intends to become a library that provides complex form elements for developers to use in their modules.

Written by Heine Deelstra.

This module was commissioned by the NCRV (http://www.ncrv.nl/).

Elements provided
=================

1. tableselect
2. imagebutton (not working properly yet).


1. tableselect
===============
Provides a table with checkboxes or radios in the first column (similar to the table on admin/user/user).

$header = array(
  'field_key' => 'field_title',
  'field_key1' => 'field_title1',
);

$options = array(
  'id1'=> array(
    'field_key' => 'value',
    'field_key1' => 'another value',
  ),

  'id2'=> array(
    'field_key' => 'value',
    'field_key1' => 'another value',
  ),
);

$form['test_multiselect'] = array(
  '#type'=> 'tableselect',
  '#header' => $header,
  '#options'=> $options,
  '#default_value'=> array('id1' => ''),
);


$form['test_single_select'] = array(
  '#type'=> 'tableselect',
  '#header' => $header,
  '#options'=> $options,
  '#multiple' => FALSE,
  '#default_value'=> 'id1',
);

Properties tableselect
======================
#header
  The table header, an array of field_key => title pairs.
#options
  The data displayed in the table. Nested array of id => array pairs where the array is an array of field_key => value pairs.
#multiple
  Determines whether multiple values can be selected. Displays checkboxes when TRUE, radios when FALSE.
    Default: TRUE
#js_select
  Whether to provide advanced selection behaviour (SELECT ALL checkbox, SHIFT-select).
    Default: TRUE - when #multiple is TRUE.
    When #multiple is FALSE, always FALSE.
#default_value
  Provide an array of id => x pairs for the ids that should be selected by default when #multiple is TRUE.
  Provide the id as a scalar for the id that should be selected by default when #multiple is FALSE.
#empty
  The message to show in a table row if there are no rows to display.

File

README.txt
View source
  1. Description
  2. ===========
  3. Elements intends to become a library that provides complex form elements for developers to use in their modules.
  4. Written by Heine Deelstra.
  5. This module was commissioned by the NCRV (http://www.ncrv.nl/).
  6. Elements provided
  7. =================
  8. 1. tableselect
  9. 2. imagebutton (not working properly yet).
  10. 1. tableselect
  11. ===============
  12. Provides a table with checkboxes or radios in the first column (similar to the table on admin/user/user).
  13. $header = array(
  14. 'field_key' => 'field_title',
  15. 'field_key1' => 'field_title1',
  16. );
  17. $options = array(
  18. 'id1'=> array(
  19. 'field_key' => 'value',
  20. 'field_key1' => 'another value',
  21. ),
  22. 'id2'=> array(
  23. 'field_key' => 'value',
  24. 'field_key1' => 'another value',
  25. ),
  26. );
  27. $form['test_multiselect'] = array(
  28. '#type'=> 'tableselect',
  29. '#header' => $header,
  30. '#options'=> $options,
  31. '#default_value'=> array('id1' => ''),
  32. );
  33. $form['test_single_select'] = array(
  34. '#type'=> 'tableselect',
  35. '#header' => $header,
  36. '#options'=> $options,
  37. '#multiple' => FALSE,
  38. '#default_value'=> 'id1',
  39. );
  40. Properties tableselect
  41. ======================
  42. #header
  43. The table header, an array of field_key => title pairs.
  44. #options
  45. The data displayed in the table. Nested array of id => array pairs where the array is an array of field_key => value pairs.
  46. #multiple
  47. Determines whether multiple values can be selected. Displays checkboxes when TRUE, radios when FALSE.
  48. Default: TRUE
  49. #js_select
  50. Whether to provide advanced selection behaviour (SELECT ALL checkbox, SHIFT-select).
  51. Default: TRUE - when #multiple is TRUE.
  52. When #multiple is FALSE, always FALSE.
  53. #default_value
  54. Provide an array of id => x pairs for the ids that should be selected by default when #multiple is TRUE.
  55. Provide the id as a scalar for the id that should be selected by default when #multiple is FALSE.
  56. #empty
  57. The message to show in a table row if there are no rows to display.