I am having a bit of difficulty refering to a table element of the Jqgrid directly as it appears to be lacking a id element. Is there any way to do so?
When I look at the source code, I see a non-standard aria-labelledby element which I am assuming is Jqgrid's own but doesn't help me.
Any ideas?
I have refered to the grid table as follows:
$('#gbox_mytableID table')
I am assuming one could also do
$('[aria-describedby=mytableID]')
But I haven't verified it.
My html looks like this:
<table id="mytableId"></table>
Related
I am facing issue in selecting a particular drop down from the webpage.
I need to select the second highlighted div tag in the image above.
The xpath that I am trying to use is:
//div[#class='page-container']//table//div[#class='ui-multiselect-selected-container']
Kindly suggest how can I edit the xpath to select the second div tag.
I am new to xpaths and any help will be appreciated.
I think the below xpath should work to locate the second instance
(//div[#class='ui-multiselect-selected-container'])[2]
The second row has a tr class. When you use //div[#class='page-container']//table//div[#class='ui-multiselect-selected-container'] since your are referring to relative div(using //) it points to 1st element found by default.
I see that the tr element for the second multiselect has a class attribute, which makes unique
so, this will be //div[#class='page-container']//table//tr[#class='rowRelativeTo']//div[#class='ui-multiselect-selected-container']
You can also use the style elements which are unique:
//div[#class='page-container']//table//tr[#class='rowRelativeTo']//div[#style='float:right'] /div[#class='ui-multiselect-selected-container']
I have my website setup to use the KendoUI framework and I have pulled in some external internet code with forms. To make it look like Kendo i have set the following to make all my select's into a kendoDropDownList:
$("select").kendoDropDownList();
This works fine. However there is one particular select that I like to convert into a kendoComboBox.
Is there a way to replace or remove the kendoDropDownList from my element and put the kendoComboBox instead.
Thanks in advance
Karel
If you need to single out one select, then you'll need to use a more specific jQuery selector (an id, text, CSS class, containing div, etc.).
For example, if your select elements have id's, you could do something like:
$("select:not([id='myComboBox'])").kendoDropDownList();
$("select[id='myComboBox']").kendoComboBox();
Really, you just need to do something to separate that select from the rest of them.
If you are unfamiliar with jQuery selectors (or just need a refresher), you can find the full documentation here: http://api.jquery.com/category/selectors/
Here's an example fiddle of this working: http://jsfiddle.net/ATNkC/1/
I have sth like this:
<a4j:repeat value="#{results}" var="hdr" rowKeyVar="idx">
<rich:dataTable var="item" value="#{results}" id="tbl#{idx}" first="#{idx}" rows="1">
<a4j:commandButton value="update this table only" reRender="tbl#{idx}" />
</rich:dataTable>
</a4j:repeat>
When I check from the output html, the data table has id like form:0:tbl that has no idx at the end.
The reRender will work when there is only one row in the results.
So here comes some questions:
Why doesn't dataTable's id works with EL expression while the "first" attribute works nicely?
How does reRender work that even I just specify tbl it can still be resolved while the actual HTML id is something longer like form:0:tbl? (if I know how does reRender work, I maybe able to hack it to work with a4j:repeat...)
Is there any technique or workaround that I could use to refresh only a specific dataTable that is inside a4j:repeat?
In fact I have successfully reRendered the whole a4j:repeat block surrounded by s:div. But refreshing the whole block would reset the scrollbar so it isn't desired....
For 1, it is possible that the life cycle of the table is in a different phase.
For 2, it refers to UIComponent.findComponent in fact for looking up a component given an ID.
For 3, perhaps try to use UIComponent.findComponent() or #{rich:clientId('id')} to see whether the actual HTML element ID of the a4j:repeat embedded rich:dataTable to be retrieved.
If yes, then somehow reRender can be made to work. If no, look if there is anything that can override how reRender looks for component.
Okay latest experiment shows that simply using the rich:dataTable id can do.
Keys to remember:
Inside a4j:repeat, the absolute name of the id of dataTable will have something like :0: :1: for the corresponding index.
However, to locate it, simply using the same id as defined in rich:dataTable is okay. Don't append any suffix at the end.
When observing the ajax data from Chrome, the reRendered portion is just the same related dataTable of the component.
Conclusion, think too much, failed to try the simplest solution at the start.
Most of the examples that are provided in jqgrid documentation starts off with table tag with an id. Can we create/initialize the grid with say div or any other html tag?
A quick glimpse into jqGrid source code will reveal following snippet:
if(this.tagName.toUpperCase()!='TABLE') {
alert("Element is not a table");
return;
}
So the element must be a table.
There is no explicit check for id attribute, but it is used in several places for building the surrounding elements so you should keep it as well.
I have a table which have information which I would like to exclude from the search box. For example, in one of the columns I have some text and then links, it looks like that:
<td>
<div>John Doe</div>
<div>
View |
Edit |
Delete
</div>
</td>
Of-course in this case I would like the search box to consider only "John Doe" as a text to be searched.
I draw my table in php (I use Symfony-2) and apply the DataTable plugin using dataTable function with jQuery. I got the impression that what I want is possible, but couldn't manage to achieve it. Other discussions like http://www.datatables.net/forums/discussion/255/customising-the-way-the-filter-works/p1 neither helped me to solve this problem.
Thanks!
I'm sure there are ways to customize the actual search function (you could specify the type for the column using mDataProp and then write a custom filter for that type maybe?).
But a different way to go about it is to have your PHP script only supply the name: John Doe. This will be the original data for the cell.
Then in your column definitions, use fnRender() to format the cell using the layout you use in your question -- and have it automatically parse the name to create the links you want (assuming all names are first and last, and all links just use the combined first/last names, this should be fairly easy to implement).
Then set bUseRendered to false for that column and it will perform all of its sorting and filtering based on the original content, not the new content. See more here.