Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8316 closed enhancement (wontfix)

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.

Change History (7)

comment:1 Changed 7 years ago by Scott González

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.

comment:2 Changed 7 years ago by Thomas W

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.

comment:3 Changed 7 years ago by Thomas W

Dialogs are almost always dynamic.

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

Thankyou.

comment:4 Changed 7 years ago by Scott González

#8326 is a duplicate of this ticket.

comment:5 Changed 7 years ago by Thomas W

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

comment:6 Changed 7 years ago by Scott González

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.

comment:7 Changed 7 years ago by Thomas W

Thanks Scott.

Note: See TracTickets for help on using tickets.