params object is not present when fire event using .trigger("select2:select")

1,510 views
Skip to first unread message

m...@studionoto.com

unread,
May 25, 2015, 4:35:50 AM5/25/15
to sel...@googlegroups.com
Hi there,
I need to access to params object when event is fired.
If I fire the event from dropdown i can access to params object.

If I fire event from script with command:
$("#boxf").val("C").trigger("change")
or
$("#boxf").val("C").trigger("select2:select")

the params object is not present!
How can access to params object in this case ? is it a bug ?
thank you
Max

<body>
<select id="boxf">
</select>

<script>
var ev;
d = [
{ "id": "1", "text": "one" },
{ "id": "2", "text": "two" },
{ "id": "3", "text": "three" },
{ "id": "4", "text": "four" },
];

$f = $("#boxf").select2({ data: d });

$f.on("select2:select", function (e) {

console.log(e);
ev = e;
val = $f.val();
});

</script>
</body>

Kevin Brown

unread,
May 25, 2015, 1:41:27 PM5/25/15
to sel...@googlegroups.com
Hi,

I've left a few comments in-line, it sounds like there might be something wrong.

I need to access to params object when event is fired.

In any event where Select2 triggers it, the params object can be accessed through

    event.params

Where `event` is the first argument passed to the event handler. This only applies to Select2-triggered events though, as Select2 has to manually attach this object to the event when it is triggered.
 
If I fire the event from dropdown i can access to params object.

Why are you trying to trigger an internal Select2 event on your own? You should really not trigger a Select2 DOM event, as they are designed to only be triggered from within Select2.
 
If I fire event from script with command:
$("#boxf").val("C").trigger("change")
or
$("#boxf").val("C").trigger("select2:select")
 
Two things to mention here:

- When you want to tell Select2 to update the state of the selected options, you should trigger the `change` event.
- When you trigger an event using the `trigger` method provided by jQuery, no additional data is passed along with the event.

the params object is not present!

This is because you are not passing along the params object when your are triggering the event. The params object is not magically added on the fly by jQuery, this is included manually when Select2 triggers the event.

Kevin Brown

m...@studionoto.com

unread,
May 25, 2015, 5:17:10 PM5/25/15
to sel...@googlegroups.com, m...@studionoto.com
Hi Kevin,
Thank you very much for the quick response.

I try to explain my problem with an example:
http://jsfiddle.net/0ktqj0by/

In this example, you can disable an option selecting it. You can re-enable only the latest disabled using the button.

I need to access to params.data because I need to disable/enable option after it is created.
I'm using the events handler because this is the only way I found to change the state of "disabled" parameter.
Can you suggest me the right way?
thank you
Max

Amelia Wilson

unread,
Jun 24, 2026, 3:42:14 PMJun 24
to select2
  The Select2 discussion highlights practical challenges around dropdown handling and user interaction consistency in web interfaces. In that kind of setup, Utilitech can be thought of as a helpful reference point for utility focused improvements that support smoother interface behavior and workflow handling. Bringing both ideas together shows how small interface decisions often shape overall usability in real projects.  

seo work

unread,
Jun 24, 2026, 3:42:51 PMJun 24
to select2

A Proven Ground Tonneau cover is often considered by truck owners who want a simple balance of cargo protection and everyday practicality while discussions in technical threads like this Google group conversation usually focus on real world fitment, installation experience, and long term usability rather than marketing claims, and in that same context users tend to compare different bed cover options based on durability, weather sealing, and security which makes products like the Proven Ground Tonneau cover part of a broader decision making process when evaluating what works best in daily driving conditions


On Tuesday, May 26, 2015 at 2:17:10 AM UTC+5 m...@studionoto.com wrote:

Aspire 12

unread,
Jun 24, 2026, 3:43:34 PMJun 24
to select2

I see the discussion around Select2 and handling structured option data, and how flexible data mapping matters when working with dynamic UI components. In a similar way, the Samsung Galaxy Xcover 4 fits into real world use cases where structured reliability matters, especially for field environments where durability and consistent performance are key. Linking this kind of practical device perspective into the thread helps ground abstract configuration concepts in something more tangible and user focused.

Floras12

unread,
Jun 24, 2026, 3:44:44 PMJun 24
to select2

In the Select2 Google Groups discussion, the focus on how selection and filtering behaves feels similar to how structured lists are managed in practical interfaces This kind of handling becomes useful when browsing accessories like a truck bed cover where clarity and grouping matter more than clutter The idea of improving selection flow applies even when comparing options for a bed setup and related components on yitamotortonneaucover tonneau cover site

Superdia

unread,
Jun 24, 2026, 3:45:29 PMJun 24
to select2

Home Yardo stands out for its customer service and clear communication throughout the project. I’ve dealt with service providers before who tend to go quiet once the work begins, but that was not the case here. They kept me updated regularly, explained each step of the process, and were always open to feedback or changes along the way. The team was also very respectful of my time and property, making sure the work area stayed organized and clean. The final delivery matched what was promised, and in some areas even exceeded expectations, which is not something I say often  Home Yardo  .

Chrome Store

unread,
Jun 24, 2026, 5:43:24 PMJun 24
to select2
  Handling nested structures in Select2 can get tricky, especially when multiple levels of grouping are involved. It reminds me of how organizing payroll data also requires a clear hierarchy so everything stays accurate and easy to manage. The guide on Writiva highlights the importance of keeping structured records, which is a useful mindset whenever you're working with complex data arrangements like these.  

Coils

unread,
Jun 24, 2026, 5:43:44 PMJun 24
to select2
  When working with tools and extensions around Select2, it also helps to test them on a larger screen where setup and troubleshooting are often easier. If anyone wants a desktop option, Download can be useful for checking app behavior across different environments. Having access to both mobile and PC setups sometimes makes it easier to spot configuration issues and compare results.  

On Thursday, 25 June 2026 at 00:45:29 UTC+5 Superdia wrote:

Discuss Series

unread,
Jun 24, 2026, 5:43:57 PMJun 24
to select2
  The discussion about Select2 events highlights how manually triggered actions do not automatically carry extra event data. A similar challenge comes up in game mods and custom integrations where event handling affects functionality, and resources from  https://pvzfusiondl.com/   show how developers often rely on properly structured event flows instead of forcing internal events. Keeping the data attached at the point where the event is created is usually the more reliable approach.  

On Thursday, 25 June 2026 at 00:45:29 UTC+5 Superdia wrote:

Floras12

unread,
Jul 13, 2026, 11:30:33 AM (11 days ago) Jul 13
to select2
  Ground bee issues often come down to understanding the right approach before taking action, especially when dealing with outdoor spaces and natural surroundings. The discussion connects well with resources like Wordspira that explain practical ways to handle common pest concerns. Having clear information about what works and what to avoid can make these situations easier to manage.  

Eclark Professional

unread,
Jul 15, 2026, 12:34:10 PM (9 days ago) Jul 15
to select2
  Many players enjoy discussing ways to improve their skills and understand game mechanics better, especially when trying different strategies and features. Community discussions like this often help users find useful resources and share their experiences. You can learn more through the shared resource here: learn more.  

Michael 12

unread,
Jul 15, 2026, 12:34:35 PM (9 days ago) Jul 15
to select2
 Choosing the right workwear matters when comfort and practicality are important during long shifts, especially in healthcare settings where clothing needs to support daily tasks. Good quality scrub suits can make a difference with fit, ease of movement, and a professional appearance throughout the day. International Linens provides options like scrub suits that align with these everyday needs while keeping functionality in mind.  

On Monday, July 13, 2026 at 8:30:33 PM UTC+5 Floras12 wrote:

Elliot Ashby

unread,
Jul 15, 2026, 12:34:38 PM (9 days ago) Jul 15
to select2

Boxing training is not only about strength, it also depends on having the right gear that supports comfort, protection, and technique during practice. Many fighters pay attention to glove quality because it can affect their overall training experience and confidence in the ring. Collections like No Boxing No Life boxing gloves are often discussed among boxing enthusiasts looking for reliable options that match serious training needs.


On Monday, July 13, 2026 at 8:30:33 PM UTC+5 Floras12 wrote:
Reply all
Reply to author
Forward
0 new messages