views:

50

answers:

1

I couln't find any working example so i am trying my luck. i have a list of pages that i want to edit them via a jquery ui dialog. I already have every edit link with it's own id -- but i have no idea how to tell this jquery line $('#open_edit_by').click(function() { to open a window by id. (if i use php - it will work just for one). i know there must be some jquery function to do this but i need some help!

A: 
        $("#create-company").click(function () {
            $('#popupCreateCompany').dialog('open');
        });

        $("#create-service_line").click(function () {
            $('#popupCreateService_Line').dialog('open');
        });

        $('#popupCreateCompany').dialog(
        {
            autoOpen: false,
            modal: true,
            width: 600,
            open: function (event, ui) {
                $('#secondary').attr('checked', 'true');
            },
            buttons:
            {
                'Add': function () {
                    ...
                }
                'Cancel': function () {
                    $(this).dialog('close');
                }
            }
        });
RememberME
am i missing something or this is an example just for two dialogs. and i need for more. to re-make a bit the question. all the links are generated with php something like this: <a href="<?php echo $action['href']; ?>"><span id="open_edit_by<?php echo $category['category_id']; ?>"><?php echo $action['text']; ?></a> so what i want to manipulate is id="open_edit_by<?php echo $category['category_id']; ?>" and get that id dynamiclly here: $('#open_category_dialog').click(function() {
ciprian
I included code for 2 dialogs, but the same can be done for more. I have many more than that. If you need help with php, you should tag your question as such.
RememberME