vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.71k forks source link

Cannot put initial values #348

Closed bkielbasa closed 2 years ago

bkielbasa commented 11 years ago

Hi, I tried to put some initial values. Here is my custom element: https://gist.github.com/bkielbasa/78a7f2a06be14e857fff

This is how I initialize it:

    jQuery(element).editable({
        url: '{{ url('sales/order/update') }}',
        name: 'delivery',
        type: 'customize',
        tpl: '<table>'
         + '<tr><td>Komentarz:</td><td><span class="customer_comment">' + jQuery(element).data('comment') +'</span></td></tr>' 
         + '<tr><td>Status:</td><td>{{ deliveryStatuses('html') }}</td></tr>' 
         + '<tr><td>Typ:</td><td>{{ deliveryTypes('html') }}</td></tr>'
         + '<tr><td>Kurier:</td><td>{{ couriersList('html') }}</td></tr>'
         + '</table>',

         value: {
            courier: 'ups'
         }
    });

deliveryStatuses, deliveryTypes, couriersList - methods which render a html select elements.

vitalets commented 11 years ago

hi, could you make a jsfiddle to show the issue?

sorry for late reply..