Show Posts
|
Pages: 1 ... 12 13 [14] 15
|
196
|
General Category / EasyUI for jQuery / "Card view" editing
|
on: September 05, 2013, 12:11:11 PM
|
is there any example of editing in card view? I don't see code for the datagrid in the src folder, and the code in the plugins folder is also obfuscated and hard to follow. I don't really see an equivalent to renderRow for the row editor. I do see how I might make new cell editors, just not for replacing the whole row.
|
|
|
198
|
General Category / EasyUI for jQuery / required fields in datagrid?
|
on: September 04, 2013, 10:40:21 AM
|
I have grid editing working based on the "Row Editing in DataGrid" example. in the example there's a combobox that's marked Required and I have that working. I'm trying to make a text box required also, and this isn't doing it. <th data-options="field:'F1',width:155, editor:{ type:'text', options:{ required:true } }">field 1</th>
I also tried this: <th data-options="field:'F1',width:155,editor:'text',required:true">Field 1</th>
|
|
|
199
|
General Category / General Discussion / Re: javascript in ajax loaded panel
|
on: September 04, 2013, 10:30:50 AM
|
so it turns out that it's the .form('submit') that does this, and is causing other problems for me as well. my work around is to send the form data via $.ajax in the onSubmit: and then return false letting the ajax success handle loading the content..
|
|
|
200
|
General Category / General Discussion / Re: javascript in ajax loaded panel
|
on: August 30, 2013, 08:31:20 AM
|
I just noticed something in Chrome's inspector.
I'm getting iframes with my contentdata in them with id's like "easyui_frame_1377876179527". if I make the javascript so that it generates a fatal error, the iframe is left there and I can see it.
is .panel({ content: contentdata } ) loading the content into an iframe, then copying it into the document, then removing the iframe? that's this looks like. and if so, that's why $(function() {}) isn't working. the iframe doesn't have the the script tags to load jquery and that's why I'm getting errors.
in my previous framework my content loader used jquery's $.ajax() and did not have this problem.
|
|
|
203
|
General Category / EasyUI for jQuery / validatebox, adding a new rule
|
on: August 22, 2013, 02:09:36 PM
|
I'm looking for a cleaner way to do this: <script> $.extend($.fn.validatebox.defaults.rules, { pickonemore: { validator: function(value,param){ var hasone = false; $(param).each(function(k,p) { if ($(p).val() != "") hasone = true; }); if(hasone) { $(param).each(function(k,p) { $(p).validatebox('disableValidation'); }); } else { $(param).each(function(k,p) { $(p).validatebox('enableValidation'); }); } return hasone; }, message: 'Enter at least one value in this group.' } }); </script> <input id="box1" class="easyui-validatebox" type="text" name="box1" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td> <input id="box2" class="easyui-validatebox" type="text" name="box2" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td> <input id="box3" class="easyui-validatebox" type="text" name="box3" required="required" validType="pickonemore['#box1','#box2','#box3']"></input></td>
goal is to require one or more of the 3 values to be entered. I'm using enableValidation/disableValidation calls because my new validator does not seemed to be called when a box is blank. is there a better way?
|
|
|
205
|
General Category / General Discussion / Re: javascript in ajax loaded panel
|
on: August 22, 2013, 12:05:41 PM
|
so this works: var contentdata = '<div><form><select id="foo" class="easyui-combobox"><option value="x1">x1</option><option value="x">x</option></select></form></div>' + '<script>' + 'function content_onload() {' + ' $("#foo").combobox().combobox("select", "x");' + '}' + '<\/script>'; var centerpanel = $('#mainlayout').layout('panel','center'); centerpanel.panel({content:contentdata}); content_onload();
has to be some sort of timing issue. maybe only related to Chrome, I haven't tested other browsers yet.
|
|
|
207
|
General Category / General Discussion / Re: javascript in ajax loaded panel
|
on: August 21, 2013, 07:15:38 PM
|
a string that contains mixed html and javascript sniplet, such as <div><form><select id="foo" class="easyui-combobox">...</select></form></div> <script> $(function() { $('#foo').combobox('select', 'x'); }); </script>
no matter what the javascript is, if it uses jquery, I get the error the 2nd+ times contentdata is loaded in, but not the first time, even if is the exact same content.
|
|
|
209
|
General Category / General Discussion / javascript in ajax loaded panel
|
on: August 21, 2013, 01:59:34 PM
|
I've got an ajax handler that validates a result and does this: centerpanel = $('#mainlayout').layout('panel', 'center'); centerpanel.panel({ content: contentdata } );
contentdata sometimes has javascript in it, using $(function(){...}); to do some modifications to forms and such. the first one like this loads and works correctly, the 2nd one causes the "$(function()" line to generate "Uncaught ReferenceError: $ is not defined" errors. javascript functions in the same script block will still work though, it just doesn't like the initial jquery stuff. I've even tried modifying the code, the first $( always works, the 2nd+ always error, no matter what the code is. I've done this before using jquery's .html() and the code always runs fun, but doing .html(contentdata); to a panel seems to turn the panel into a plain div. is there a better way to handle the javascript blocks, or something I need to do to bless them?
|
|
|
|