Skip to main content

Search and Top Navigation

#8316 closed enhancement (wontfix)

Opened May 14, 2012 04:00AM UTC

Closed May 14, 2012 12:58PM UTC

Last modified May 22, 2012 01:32AM UTC

dialog() docs; needs a 'dynamic' example.

Reported by: Thomas W Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.20
Keywords: Cc:
Blocked by: Blocking:
Description

Existing docs on http://jqueryui.com/demos/dialog/ gives only examples of calling dialog on $(foo) or $('#dialog').

An example would be extremely useful, of how to create a dialog dynamically -- as most dialogs want to be triggered from JS with *dynamic* message, not content already existing in some static <div>.

Existing docs:

A call to $(foo).dialog()

Additional example: Dynamic dialog can be created, at runtime:

$('<div/>').html( yourMessage).dialog();

Thanks.

Attachments (0)
Change History (7)

Changed May 14, 2012 12:58PM UTC by scottgonzalez comment:1

resolution: → wontfix
status: newclosed

Sorry, but we can't document every use. This has nothing to do with jQuery UI and has everything to do with the most basic usage of jQuery.

Changed May 15, 2012 09:15AM UTC by Thomas W comment:2

Give me an example in the docs or demonstration, which runs from JS code, and doesn't depend on existing DIVs. The documentation page has 4 examples + a demo.. just one in a 'dynamic' form, would show people.

Ever heard of window.alert()? That's what most people want to do with a dialog. The existing docs don't reflect 90% of people's practical usecases -- almost all dialogs are dynamic.

I'd like to help you, and other users, out. Kindly don't just close the issue when legitimate usecases & actual practical/business usage aren't correct in the supposedly technically-perfect system. Again -- I'm trying to help people out here.

Thank you.

Changed May 16, 2012 12:39AM UTC by Thomas W comment:3

Dialogs are almost always dynamic.

Please provide an example, to reflect this (the most common) usecase.

Thankyou.

Changed May 16, 2012 01:54PM UTC by scottgonzalez comment:4

#8326 is a duplicate of this ticket.

Changed May 17, 2012 02:54AM UTC by Thomas W comment:5

Hi Scott, is there someone who focuses more on "documentation", or an Open-Source way for me to contribute to this myself?

I just want to help people, by providing a single doc/example of the most-common use case.

ie. Calling it from JS, like 'window.alert()'.

I can't feel doc is complete, or correct, without *one* example callable from code.

Let me know.

Regards,

Tom

Changed May 17, 2012 01:38PM UTC by scottgonzalez comment:6

There are multiple reasons to dynamically create dialogs, replacing alerts is only one of them. What you're asking for is much more of a tutorial than API documentation. Feel free to talk to Adam Sontag about writing a tutorial for the upcoming Learn site.

Changed May 22, 2012 01:32AM UTC by Thomas W comment:7

Thanks Scott.